fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. int y,m;
  6.  
  7. scanf("%d/%d",&y,&m);
  8. switch(m){
  9. case 1:
  10. case 3:
  11. case 5:
  12. case 7:
  13. case 8:
  14. case 10:
  15. case 12:
  16. printf("その月は31日あります。");
  17. break;
  18. case 4:
  19. case 6:
  20. case 9:
  21. case 11:
  22. printf("その月は30日あります。");
  23. break;
  24. case 2:
  25. if(((y%4==0) && (y%100!=0)) || (y%400==0)){
  26. printf("その月は29日あります。");
  27. }
  28. else{
  29. printf("その月は28日あります。");
  30. }
  31. }
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0s 5316KB
stdin
2026/4
stdout
その月は30日あります。