#include<bits/stdc++.h> using namespace std; int main() { int y,m,d; char c; while(cin>>y>>c>>m>>c>>d) { int sum; if((y%100==0&&y%400==0)||(y%100!=0&&y%4==0)) sum=1; else sum=0; switch(m) { case 1: sum=d; cout<<sum<<endl; break; case 2: sum=31+d; cout<<sum<<endl; break; case 3: sum+=31+28+d; cout<<sum<<endl; break; case 4: sum+=31+28+31+d; cout<<sum<<endl; break; case 5: sum+=31+28+31+30+d; cout<<sum<<endl; break; case 6: sum+=31+28+31+30+31+d; cout<<sum<<endl; break; case 7: sum+=31+28+31+30+31+30+d; cout<<sum<<endl; break; case 8: sum+=31+28+31+30+31+30+31+d; cout<<sum<<endl; break; case 9: sum+=31+28+31+30+31+30+31+31+d; cout<<sum<<endl; break; case 10: sum+=31+28+31+30+31+30+31+31+30+d; cout<<sum<<endl; break; case 11: sum+=31+28+31+30+31+30+31+31+30+31+d; cout<<sum<<endl; break; case 12: sum+=31+28+31+30+31+30+31+31+30+31+30+d; cout<<sum<<endl; break; } } return 0; }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:333 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:600 |
C语言程序设计教程(第三版)课后习题7.4 (Java代码)浏览:873 |
C语言程序设计教程(第三版)课后习题8.3 (Java代码)浏览:1402 |
最小公倍数 (C语言代码)浏览:894 |
淘淘的名单 (C语言代码)浏览:1167 |
WU-输出九九乘法表 (C++代码)浏览:1852 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:580 |
1011题解浏览:819 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:654 |