题目内容

下面程序的功能是将从键盘输入的偶数写成两个素数之和。请选择填空。#include #include main(){int a,b,c,d;scanf("%d",&A.;for(b=3,b<=a/2;b+=2) {for(c=2;c<=sqrt(B.;c++) if(b%c==0) break; if(c>sqrt(B.) d=;else continue; for(c=2;c<=sqrt(D.;c++) if(d%c==0) break; if(c>sqrt(D.) printf("%d=%d+%d\n",a,b,D.; }}

A. a+b
B. a-b
C. a*b
D. a/b

查看答案
更多问题

下面程序的运行结果是。#includemain(){int k=0;char c='A';do{switch(c++) {case 'A':k++;break; case 'B':k--; case 'C':k+=2;break; case 'D':k=k%2;break; case 'E':k=k*10;break; default:k=k/3; } k++;}while(c<'G');printf("k=%d\n",k);}

A. k=3
B. k=4
C. k=2
D. k=0

若运行以下程序时,从键盘输入3.6 2.4,则下面程序的运行结果是。#include#includemain(){float x,y,z;scanf("%f%f",&x,&y);z=x/y;while(1){if(fabs(z)>1.0) {x=y;y=z;z=x/y;} else break;}printf("%f\n",y);}

A. 1.500000
B. 1.600000
C. 2.000000
D. 2.400000

下面程序的运行结果是。#includemain(){int a,b;for(a=1,b=1;a<=100;a++){if(b>=20) break; if(b%3==1){b+=3;continue;}b-=5;}printf("%d\n",A.;}

A. 7
B. 8
C. 9
D. 10

下面程序的运行结果是。#includemain(){int i,j,x=0;for(i=0;i<2;i++) {x++; for(j=0;j<=3;j++) {if(j%2) continue; x++; } x++; } printf("x=%d\n",x);}

A. x=4
B. x=8
C. x=6
D. x=12

答案查题题库