[讨论]大家来看看我这个程序有毛病吗?
#include<iostream>int main()
{
int firsty=2000;
int endy=2400;
int i=1;
int a=0;
std::cout<<"从"<<firsty;
while(firsty<=endy)
{
if(firsty%4==0&&firsty%100!=0||firsty%400==0)
a=a+1;
firsty=firsty+i;
}
std::cout<<"年到"<<endy<<"年有"<<a<<"个闰年";
getchar();
}
[此贴子已经被作者于2006-7-28 20:53:38编辑过]