Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2609 孙浚轩 18岁生日 C++ Wrong Answer 0 MS 260 KB 1937 2024-01-15 22:04:10

Tests(0/1):


Code:

#include<iostream> using namespace std; int isleapyear(int x){ if(x%400==0||x%4==0&&x%100!=0) return 1; else return 0; } int main(){ int t; cin>>t; while(t--){ int y,m,d; char c1,c2; cin>>y>>c1>>m>>c2>>d; int y2=y+18,ds=0,mld; while(y!=y2){ while(m!=13){ switch(m){ case 1: mld=31; break; case 2: if(isleapyear(y)==1) mld=29; else mld=28; break; case 3: mld=31; break; case 4: mld=30; break; case 5: mld=31; break; case 6: mld=30; break; case 7: mld=31; break; case 8: mld=31; break; case 9: mld=30; break; case 10: mld=31; break; case 11: mld=30; break; case 12: mld=31; break; } while(d!=mld){ d++; ds++; } m++; d=1; ds++; } y++; m=1; } cout<<ds<<endl; } return 0; }


Run Info:

------Input------
11 1989-11-26 1962-12-02 1963-03-27 1990-03-31 1900-02-28 2000-02-29 2008-08-08 1995-02-28 2012-02-29 2020-02-28 1982-03-01
------Answer-----
6574 6575 6575 6575 6574 -1 6574 6575 -1 6575 6575
------Your output-----
6245 6239 6490 6485 6516 6516 6355 6517 6516 6517 6515