TOPIC

Why I'm getting Wrong Answer(100%). What is wrong?

Sunjare asked 4 years ago


#include<iostream>
using namespace std;

int main(){

int year;

while(cin>>year){

bool leap = false;
   if((year%4==0 && year%100!=0) || year%400==0){
       leap = true;
   }

bool huluculu = false;
if(year%15==0){
    huluculu = true;
}

bool bulukulu = false;

if(year%55==0){
    if(leap){
        bulukulu = true;
    }
}

if(leap){
      cout<<"This is leap year."<<endl;
}

if(huluculu){
       cout<<"This is huluculu festival year."<<endl;
}

if(bulukulu){
            cout<<"This is bulukulu festival year."<<endl;
}

if(!leap && !huluculu && !bulukulu){
    cout<<"This is an ordinary year."<<endl;
}

cout<<endl;

}

return 0;
}
> 

Remember not post solutions. Your post may be reviewed by our moderators.

  • alexis__t replied 4 years ago

    In description of the problem: All the years will not be less than 2000 (to avoid the earlier different rules for leap years) but can have more than 1000 digits.