1 条题解
-
2Coppertone LV 7 @ 2022-07-13 14:33:06
#include<iostream> int mo[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; using namespace std; int main() { int a,b,c,i; cin>>a>>b>>c; for(i=1;i<=10000;i++) { c++; if(a%4==0&&b==2) { if(c>29) { c=1; b++; } } else if(c>mo[b]) { c=1; b++; if(b>12) { b=1; a++; } } } cout<<a<<"-"<<b<<"-"<<c; return 0; }
- 1