#include <stdio.h>
main ()
{ int y; for (y=2000;y<=3000;y++) { if ((y%4==0&&y%100!=0)||y%400==0) printf ("%d",y); }
}
请问下如何让程序能输入10个后换行..(加个变量控制换行但是不知道加哪...)
#include <stdio.h>
int main ()
{ int count = 0; int y; for (y=2000;y<=3000;y++) { if ((y%4==0&&y%100!=0)||y%400==0){ count++; printf ("%d",y); } if(count%10==0) printf("\n"); } return 0;
}