P51-10

来源:互联网 发布:mac python idle 运行 编辑:程序博客网 时间:2024/05/01 21:41

10.

#include <stdio.h>#include <math.h>int main (){ int year,month; printf("please input year and month\n"); scanf("%d%d",&year,&month); if(year%4==0) {  if(month == 2)   printf("该月的天数是:29\n");  else if (month == 4 || 6 || 9 || 11)   printf("该月的天数是:30\n");  else   printf("该月的天数是:31\n"); } else {   if(month == 2)   printf("该月的天数是:28\n");  else if (month == 4 || 6 || 9 || 11)   printf("该月的天数是:30\n");  else   printf("该月的天数是:31\n"); } return 0;}


0 0
原创粉丝点击