Untitled
unknown
plain_text
2 years ago
487 B
8
Indexable
#include <iostream>
using namespace std;
void yourKoresh(int age) {
int key=0;
if (age > 10) {
key = 1;
}
if (age > 20) {
key = 2;
}
if (age > 30) {
key = 3;
}
if (age > 40) {
key = 4;
}
switch (key) {
case 1: cout << "moldoy";
break;
case 2: cout << "bivaliy";
break;
case 3: cout << "starche";
break;
case 4: cout << "ne bivaet";
break;
default: cout << "perec";
}
}
int main()
{
int x;
cin >> x;
yourKoresh(x);
}
Editor is loading...