Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int day,month;
  8. cout<<"day?"<<endl;
  9. cin >> day;
  10. cout<<"month?"<<endl;
  11. cin >> month;
  12.  
  13. switch(month){
  14. case 1:
  15. case 2:
  16. case 3: {
  17. if (day <= 21)
  18. cout<<"winter"<<endl;
  19. else
  20. cout<<"spring"<<endl;
  21. break;
  22. }
  23. case 4:
  24. case 5:
  25. case 6: {
  26. if (day <= 22)
  27. cout<<"spring"<<endl;
  28. else
  29. cout<<"summer"<<endl;
  30. break;
  31. }
  32. case 7:
  33. case 8:
  34. case 9: {
  35. if (day <= 23)
  36. cout<<"summer"<<endl;
  37. else
  38. cout<<"autum"<<endl;
  39. break;
  40. }
  41. case 10:
  42. case 11:
  43. case 12: {
  44. if (day <= 21)
  45. cout<<"autum"<<endl;
  46. else
  47. cout<<"winter"<<endl;
  48. break;
  49. }
  50. default:
  51. cout<<"default"<<endl;
  52. }
  53.  
  54. return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement