Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2610 孙浚轩 18岁生日 C++ Runtime Error 1988 MS 264 KB 2261 2024-01-15 22:12:23

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,m2=m,d2=d,ds=0,mld; if(m==2&&d==29) cout<<-1; else{ while(y!=y2||m!=m2||d!=d2){ 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:

Runtime Error:[ERROR] A not allowed system call.
Call ID:275