#41676: c++解法+注意事項


yp11351280@yphs.tp.edu.tw (810-43韓睿哲)


不可以用while(輸入的數!=0)去做,要用if(輸入的數!=0),否則會TLE。

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a, c;
    while(cin>>a){
    if(a!=0){
    if(a%4==0&&a%100!=0||a%400==0)
    cout<<"a leap year"<<endl;
    else
    cout<<"a normal year"<<endl;
}
else
return 0;
}
}