T1 Q2
This commit is contained in:
parent
3d2827578e
commit
a7efeab624
17
main.cpp
17
main.cpp
@ -3,13 +3,12 @@
|
||||
using string = std::string;
|
||||
|
||||
int main() {
|
||||
std::cout << "Enter your age:\n";
|
||||
int age {0};
|
||||
std::cin >> age;
|
||||
if (age < 18)
|
||||
std::cout << age << " is too young.\n";
|
||||
else if (age > 30)
|
||||
std::cout << age << " is too old.\n";
|
||||
else
|
||||
std::cout << age << " is the right age.\n";
|
||||
std::cout << "Enter your name:\n";
|
||||
string name;
|
||||
std::cin >> name;
|
||||
std::cout << "Hello, " << name << "!\n";
|
||||
for (int i {0}; i < static_cast<int>(name.size()) + 8; i++) {
|
||||
std::cout << "=";
|
||||
}
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user