There is a syntax error in the code. The main function is not properly defined with curly braces. It should be:

int main() { int i=0,year; for(year=2000;year<=3000;year++) { if(year%4==0&&year%100!=0||year%400==0) { if(i&&10==0) printf("\n"); printf("%d\n",year); i++; if(i%10) printf("\n"); } } return 0; }

This program prints all the leap years between 2000 and 3000, with 10 years per line.

int mainint i=0year;foryear=2000;year=3000;year++ifyear4==0&&year100!=0year400==0ifi&&10==0printfn;printfdnyear;i++;ifi10printfn;return 0;

原文地址: https://www.cveoy.top/t/topic/dUhQ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录