Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <stdio.h>
- #include <locale.h>
- #include <Windows.h>
- int _tmain(int argc, _TCHAR* argv[])
- {
- setlocale(LC_ALL, "Rus");
- short int year, ost12, ost60;
- printf("Введите год \n");
- scanf_s("%d", &year);
- ost60 = year % 60;
- switch (ost60)
- {
- case 4: case 16: case 28: case 40: case 52: printf("Год крысы\n"); break;
- case 5: case 17: case 29: case 41: case 53: printf("Год коровы\n"); break;
- case 6: case 18: case 30: case 42: case 54: printf("Год тигра\n"); break;
- case 7: case 19: case 31: case 43: case 55: printf("Год зайца\n"); break;
- case 8: case 20: case 32: case 44: case 56: printf("Год дракона\n"); break;
- case 9: case 21: case 33: case 45: case 57: printf("Год змеи\n"); break;
- case 10: case 22: case 34: case 46: case 58: printf("Год лошади\n"); break;
- case 11: case 23: case 35: case 47: case 59: printf("Год овцы\n"); break;
- case 0: case 12: case 24: case 36: case 48: printf("Год обезьяны\n"); break;
- case 1: case 13: case 25: case 37: case 49: printf("Год курицы\n"); break;
- case 2: case 14: case 26: case 38: case 50: printf("Год собаки\n"); break;
- case 3: case 15: case 27: case 39: case 51: printf("Год свиньи\n"); break;
- }
- if (ost60 >= 4 && ost60 < 16) printf("Цвет: зеленый\n");
- if (ost60 >= 16 && ost60 < 28) printf("Цвет: красный\n");
- if (ost60 >= 28 && ost60 < 40) printf("Цвет: желтый\n");
- if (ost60 >= 40 && ost60 < 52) printf("Цвет: белый\n");
- if (ost60 >= 52 && ost60 < 64) printf("Цвет: черный\n");
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement