fork download
  1. #include <stdio.h>
  2. main()
  3. {
  4. int year, month, days;
  5. scanf("%d", &year);
  6. scanf("%d", &month);
  7. switch (month) {
  8. case 1: case 3: case 5: case 7: case 8:
  9. case 10: case 12:
  10. days = 31;
  11. break;
  12. case 4: case 6: case 9: case 11:
  13. days = 30;
  14. break;
  15. case 2:
  16. if ((year % 400 == 0) ||
  17. (year % 4 == 0 && (year % 100 != 0)))
  18. days = 29;
  19. else
  20. days = 28;
  21. break;
  22. default:
  23. days = 0;
  24. }
  25. printf("%d\n", days);
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 5308KB
stdin
1904
13
stdout
0