题目内容

执行下面的程序后,a的值为。int main(void){int a,b;for(a=1,b=1; a<=100; a++){if(b>=20)break;if(b%3==1){b += 3;continue;}b -= 5;}}

查看答案
更多问题

判断某年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);}

答案查题题库