fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int x;
  6. cin >> x;
  7. if (x == 1)
  8. {
  9. cout << 31;
  10. }
  11. else if (x == 2)
  12. {
  13. cout << 28;
  14. }
  15. else if (x == 3)
  16. {
  17. cout << 31;
  18. }
  19. else if (x == 4)
  20. {
  21. cout << 30;
  22. }
  23. else if (x == 5)
  24. {
  25. cout << 31;
  26. }
  27. else if (x == 6)
  28. {
  29. cout << 30;
  30. }
  31. else if (x == 7)
  32. {
  33. cout << 31;
  34. }
  35. else if (x == 8)
  36. {
  37. cout << 31;
  38. }
  39. else if (x == 9)
  40. {
  41. cout << 30;
  42. }
  43. else if (x == 10)
  44. {
  45. cout << 31;
  46. }
  47. else if (x == 11)
  48. {
  49. cout << 30;
  50. }
  51. else if (x == 12)
  52. {
  53. cout << 31;
  54. }
  55. }
  56.  
Success #stdin #stdout 0s 5304KB
stdin
4
5
stdout
30