#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;
}
- Feb 11 Thu 2010 20:27
練習題1~50中的練習題5




