#10866: C++ - 文文我想讓你結婚啊 怎麼一直WA?


uopsdod (samcom)


#include <iostream>
using std::cin;
using std::cout;
using std::endl;

int main(){

int year;

while(cin >> year){

    if ( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ){
        cout << "閨年" << endl;
    }else{
        cout << "平年" << endl;
    }

}


return 0;
}

 

為何,到底為何一直WA

 

 

#10941: Re:C++ - 文文我想讓你結婚啊 怎麼一直WA?


410421236 (努力)


 

你有沒有考慮到你輸入的年份是負的?