Advertisement
Guest User

Untitled

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