C / C++: case
Вывод времени года по месяцу:
#include <stdio.h> #include <iostream> using namespace std; int main () { int a; cin >> a; switch (a) { case 12: cout << "zima"; break; case 1: cout << "zima"; break; case 2: cout << "zima"; break; case 3: cout << "vesna"; break; case 4: cout << "vesna"; break; case 5: cout << "vesna"; break; case 6: cout << "leto"; break; case 7: cout << "leto"; break; case 8: cout << "leto"; break; case 9: cout << "osen"; break; case 10: cout << "osen"; break; case 11: cout << "osen"; break; default: cout << "osen"; break;} }