解题思路:
注意事项:
参考代码:
#include using namespace std; struct time{ int year; int month; int day; }a; int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int main(){ int t(0); cin>>a.year>>a.month>>a.day; for(int i=1;i<a.month;i++) t+=month[i]; t+=a.day; if(!(a.year%400)||(a.year%100&&!(a.year%4))) t++; cout<<t<<endl; return 0; }
0.0分
0 人评分