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