#include <iostream>
#include <cstdlib>
using namespace std;
int main (void){
 int year;
 cout<<"請輸入西元年數: ";
 cin>>year;
 if((year%4)&&!(year%100))
   cout<<"該年為閏年"<<endl;
 else
 {
   if(!(year%400))
     cout<<"該年為閏年"<<endl;
   else
   cout<<"該年不為閏年"<<endl;
   }   
system("pause");
return 0;
}

Posted by p17johnny at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()