问题链接:第几天?
#include<bits/stdc++.h>
using namespace std;
int main(){
int yy,dd,mm;
int day[]={31,28,31,30,31,30,31,31,30,31,30,31};
while(scanf("%d/%d/%d",&yy,&mm,&dd)!=EOF){
if((yy%4==0&&yy%100!=0)||(yy%400==0)){
day[1] = 29;
}else{
day[1]=28;
}
int sum = 0;
for(int i=0;i<mm-1;i++){
sum +=day[i];
}
sum += dd;
cout << sum << endl;
}
return 0;
}