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;
|
using string = std::string;
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
std::cout << "Enter your age:\n";
|
std::cout << "Enter your name:\n";
|
||||||
int age {0};
|
string name;
|
||||||
std::cin >> age;
|
std::cin >> name;
|
||||||
if (age < 18)
|
std::cout << "Hello, " << name << "!\n";
|
||||||
std::cout << age << " is too young.\n";
|
for (int i {0}; i < static_cast<int>(name.size()) + 8; i++) {
|
||||||
else if (age > 30)
|
std::cout << "=";
|
||||||
std::cout << age << " is too old.\n";
|
}
|
||||||
else
|
std::cout << "\n";
|
||||||
std::cout << age << " is the right age.\n";
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user