闰年的判定——选择结构
闰年能被四整除,不能被100整除,但能被400整除的年份。
#include<stdio.h> int main(){ int year; scanf("%d",&year); if(year%4==0&&year%100!=0||year%400==0) printf("%d is runnian ",year); else printf("%d isnt runnian",year); return 0; }