编一个函数,若参数y为闰年,则返回1;否则返回0。
p(int year) {if((year%4==0&&year%100!=0)¦¦year%400==0)/*判别是否闰年*/ return(1); else return(0);} main() {int y; scanf("%d",&y); if(P(y))printf("%d年是闰年\n",y); else printf("%d年非闰年\n",y); }
编一个函数,若参数y为闰年,则返回1;否则返回0。
p(int year) {if((year%4==0&&year%100!=0)¦¦year%400==0)/*判别是否闰年*/ return(1); else return(0);} main() {int y; scanf("%d",&y); if(P(y))printf("%d年是闰年\n",y); else printf("%d年非闰年\n",y); }