#14795: 請幫忙除錯!!謝謝


fionahung0908 (username)

學校 : 臺北市私立延平高級中學
編號 : 69055
來源 : [180.217.99.153]
最後登入時間 :
2020-10-19 15:02:55
d047. 10070 - Leap Year or Not Leap Year and ... -- UVa10070 | From: [203.72.178.252] | 發表日期 : 2018-08-06 13:42

#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
int n,b=0;
while(cin>>n)
{
if(n%4==0&&n%100!=0||n%400==0)
{
cout<<"This is leap year."<<endl;
b=1;
}
if(n%15==0)
{
cout<<"This is huluculu festival year."<<endl;
b=1;
}
if(n%4==0&&n%100!=0&&n%55==0||n%400==0&&n%55==0)
{
cout<<"This is bulukulu festival year."<<endl;
b=1;
}
else if(b!=1)
{
cout<<"This is an ordinary year."<<endl;
}
}
}

 
ZeroJudge Forum