文章
67
粉丝
207
获赞
29
访问
35.6k
#include <iostream>
using namespace std;
int main(){
/*char a[20];
for(int i=0;i<20;i++)
a[i]=0;
cin >>a;
int year=(a[0]-'0')*1000+(a[1]-'0')*100+(a[2]-'0')*10+a[3]-'0';
int month=0,day=0;
if(a[5]=='1')
month=(a[5]-'0')*10+(a[6]-'0');
else
month=a[6]-'0';
if(a[8]!='0')
day=(a[8]-'0')*10+(a[9]-'0');
else
day=a[8]-'0';
*/
int year,month,day;
char c,g;
cin>>year>>c>>month>>g>>day;
int d=0;
if((year%400==0)||(year%4==0&&year%100!=0)){
switch(month){
case 1:d=day;break;
case 2:d=day+31;break;
case 3:d=day+31+29;break;
case 4:d=day+31+29+31;break;
case 5:d=day+31+29+31+30;break;
case 6:d=day+31+29+31+30+31;break;
case 7:d=day+31+29+31+30+31+30;break;
case 8:d=day+31+29+31+30+31+30+31;break;
case 9:d=day+31+29+31+30+31+30+31+31;break;
case 10:d=day+31+29+31+30+31+30+31+31+30;break;
case 11:d=day+31+29+...
登录后发布评论
我觉得只有一种解释就是测试有两种写法
1.2000-04-1
2.2000-04-01