#2124: 都是wa..


interior24 (FAN)


#include<stdio.h>
#include<iostream>
using namespace std;

int main()
{    
      int s;              
      while(cin >> s)     
      {
          if(s%4==0)
          {
                 if(s%100!=0)
                    cout << "閏年"  << endl;
                 if(s%100==0)
                    cout << "閏年"  << endl;
          }
          else
          {
                 if(s%400==0)
                 cout << "閏年"  << endl;
                 else
                 {
                      cout << "平年"  << endl;
                 }        
          }
         
           
      }    
      return 0;
}

 

 

我試過很多數字都沒有問題

為什麼傳上去都會是wa可以幫我看看?

#2125: Re:都是wa..

Unknown User


#include
#include
using namespace std;

int main()
{    
      int s;              
      while(cin >> s)     
      {
          if(s%4==0)
          {
                 if(s%100!=0)
                    cout << "閏年"  << endl;
                 if(s%100==0)
                    cout << "閏年"  << endl;

          }
          else
          {
                 if(s%400==0)
                 cout << "閏年"  << endl;
                 else
                 {
                      cout << "平年"  << endl;
                 }        
          }
         
           
      }    
      return 0;
}

 

 

我試過很多數字都沒有問題

為什麼傳上去都會是wa可以幫我看看?