f函数中,如果你的year不是闰年,函数就没有返回值,应该是在这有问题的吧,我在仔细看下# include int f(int year){if (year%4==0&&year%100!=0)return year;else return 0;//如果year不是闰年,返回0} int main (int) {int c=1900,a=0;for(;c<=2000;c++){ if(f(c)) { a++; cout<<f(c)<<'\t';//如果f()函数返回的是year,也就是说year为闰年,则输出year,//...