判断某年year是否是闰年,若year能被4整除100整除或能被400整除,则是闰年,否则不是闰年。在空白处填写缺失的内容。int main(void){int year;scanf("%d",&year);if( ___________________ )printf("%d is a leap year\n",year);elseprintf("%d isn’t a leap year\n",year);}
查看答案
求20以内所有3的倍数的数之和sum1,及其余数之和sum2。int main(void){int sum=0,sum2=0,i;for(i=1;i<=20;i++)if(________)sum1 += i;elsesum2 += i;printf("%d,%d\n",sum1,sum2);}
下述程序的运行结果是。#includevoid fun(int x){putchar('0'+(x% 10));// 在控制台输出 '0' + (x % 10)的值fun(x/10);}void main(){printf("\n");fun(1234);}
下列程序输出结果是____________。#include int main(void){int a=-1,b=4,k;k=(++a<0)&&!(b--<=0);printf("%d%d%d\n",k,a,b);}
下列程序的输出是#include int main(void){int x=3;do{printf("%3d\n",x-=2);}while(!(--x));}