早教吧 育儿知识 作业答案 考试题库 百科 知识分享

杭电acm2133实在找不出错误了,但是提交过不了#includeintmain(){\x05charc[7][10]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};\x05inty,m,d,s,i,q,p,b;\x05\x05inta[13]={0,31,28,31,30,31,30,31,31,30,31,30,

题目详情
杭电acm2133 实在找不出错误了 ,但是提交过不了
#includeint main(){\x05char c[7][10]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};\x05int y,m,d,s,i,q,p,b;\x05\x05int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};\x05while(scanf("%d %d %d",&y,&m,&d)!=EOF)\x05{\x05\x05q=0;\x05\x05s=0;\x05\x05 if(m==0||d==0||y==0||(m==2&&d>29)) { printf("illegal\n");\x05\x05\x05continue; }\x05\x05 if((y%400==0 ||(y%100!=0 &&y%4==0))&&m==2&&m>28)\x05\x05\x05 { printf("illegal\n");\x05\x05\x05continue; } if(m==4||m==6||m==9||m==11) { if(d>30) { printf("illegal\n");\x05\x05\x05\x05continue; } } \x05\x05for(i=1;i2 &&p!=1)\x05\x05\x05\x05{\x05\x05\x05\x05b=(y-1)*365+q+d+s;\x05\x05\x05\x05}\x05\x05\x05\x05if(m
▼优质解答
答案和解析
你把scanf("%d %d %d",&y,&m,&d);改成scanf("%d%d%d",&y,&m,&d);数字间不要加空格,平台给你数据的时候是不会给你空格的