#2124: 都是wa..


interior24 (FAN)

學校 : 國立臺東大學
編號 : 7117
來源 : [114.34.229.248]
最後登入時間 :
2020-02-19 00:36:31
a004. 文文的求婚 | From: [114.39.204.57] | 發表日期 : 2009-07-02 18:32

#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

a004. 文文的求婚 | From: [60.244.132.1] | 發表日期 : 2009-07-03 00:18

#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可以幫我看看?


 
ZeroJudge Forum