c语言编程判断闰年和季节
C语言如何判断是闰年,闰年判断条件?
C语言判断闰年条件如下:
判断语句
if( ((0 == year%4)&&(0 != year%100)) ||(0 == year %400) )
{//满足该条件的yeat就是闰年。}
#include <stdio.h> int main (void) { int year
; printf ("please a year:");
scanf ("%i",&year);
if((year%4==0 && year%100!=0)||year%400==0){
printf ("%i is a leap year!",year);
[免责声明]本文来源于网络,不代表本站立场,如转载内容涉及版权等问题,请联系邮箱:83115484@qq.com,我们会予以删除相关文章,保证您的权利。转载请注明出处:http://www.wnpsw.com/post/10823.html