#include<stdio.h>int main(void) { int i,year,n; printf("请输入n"); scanf_s("%d",&n); printf("Input -1 to quit:"); scanf_s("%d", &year); if( year==-1 ) //*如果输入值为-1,则退出
return -1; for(i=1;i<=n;i++){ printf("请输入年份:"); scanf_s("%d",&year); if((year%4==0&&year%100!=0)) //如果输入的年份能被四整除
printf("恭喜你!!这一年是闰年! "); } else{ printf("Oh NO!这一年不是闰年!! "); } } return 0; }