VC++判断闰年编译通过,输出结果错误,初学求教
#include<stdio.h>#include<stdlib.h>////Todeterminewhetheritisaleapyearvoidmain(){inti...
#include<stdio.h> #include <stdlib.h>//// To determine whether it is a leap year void main(){ int i,Y, _year; for(i=0;i<4;i++)// { printf("Please intput a year for test"); scanf("d",&_year); //输入一年计算是否闰年 Y=_year; if(_year%100==0) //如能被 100整除的话再除以400,没有余数是 { if(_year%400==0) printf("%d year is leap year",Y); } else if(_year%4==0)printf("%d year is leap year",Y);//否则除以4无余数为闰年 else printf("%d year is not leap year",Y);//有余数则不为闰年 system("pause"); } system("pause"); return;}
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询