有以下程序#include <stdio.h>main(){ int x=1, y=2, z=3; if(x>y) if(y<z) printf(
有以下程序#include <stdio.h>main() { int x=1, y=2, z=3; if(x>y) if(y<z) printf("%d", ++z); else printf("%d", ++y); printf("%d\n", x++);}程序的运行结果是A.331 B.41 C.2 D.1
有以下程序#include <stdio.h>main() { int x=1, y=2, z=3; if(x>y) if(y<z) printf("%d", ++z); else printf("%d", ++y); printf("%d\n", x++);}程序的运行结果是A.331 B.41 C.2 D.1
下面程序的功能是将小写字母变成对应大写字母后的第二个字母。其中y变成A,z变成B。
#include "stdio.h"
main()
{char c;
while((c=getchar())!='\n')
{if(c>='a'&&c<='z')
c=c-30;
if(c>'z'||c<='z'+2)
c=c-26;}
printf("%c",c);
}
错误:______
改正:______
参考答案:错误
请补充main函数,该函数的功能是:打印届1~1000中满足:个位数字的立方等于其本身所有数。
本题的结果为;1 64 125 216 729
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数main的横线上填入所编写的若干表达式或语句。
试题程序:
include <stdio .h>
main ()
{
int i,g;
clrscr ();
for (i=1; i<1000; i++)
{
g=【 】;
if(【 】)
printf ("%4d", i);
}
}
有以下程序: include<stclio.h> main() { char c; while((c=getchar())!=?)putchar(--c); } 程序运行时,如果从键盘输入:Y?N?<回车>,则输出结果为【 】。
有以下程序 #include<stdio.h> main {int y=9; for(;y>0;y--) if(y%3==0)printf("%d",--y); } 程序的运行结果是()。
A.741
B.963
C.852
D.875421
有以下程序: #include<stdio.b> void fun(char c) { if(c>X)fun(c-1): printf("%C",c); } traia() { fun(z);} 程序运行后的输出结果是()
A.xyz
B.wxyz
C.xzy
D.zvx
有以下程序 include<stdio.h> intfun(){ staticintx=1; x+=1: returnx;} main(){ inti,s=1; for(i=1;i<=5;i++)s+=fun(); printf(%d\n,s);} 程序运行后的输出结果是
A.11
B.21
C.6
D.120
有以下程序:#include <stdio.h>main(){ int i,s=0,t[] = {1,2,3,4,5,6,7,8,9}; for(i=0;i<9;i+=2) s+=*(t+i); prinff("% d \n ",s);
A.45
B.20
C.25
D.36
有以下程序: #include <stdio.h> main() { int i=1,j =2,k =3; if(i ++ == 1&&(j ==3 ‖ k ++ ==3) ) printf("% d % d % d \n" , i, j, k ); } 程序运行后的输出结果是()。
A.123
B.234
C.223
D.233
有以下程序: #include<stdio.h> #include<string.h> #include void f(char*s,char*t) { char k; k=*s; *s=*t; *t=k; s++;t--; if(*s)f(s,t): } main() {char str[10]="abcdefg",*P; P=str+strlen(str)/2+1: f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是()。
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
有以下程序: #include <stdio.h> main() { int x=3,y=2,z=1; printf("%d\n",x/y&~z); 程序运行后的输出结果是()。
A.3
B.2
C.1
D.0
有以下程序: #include<stdio.h> main() {char b,C;int i; b=a;c=A; for(i=0;i<6;i++) {if(i%2)putchar(i+b); else putchar(i+c); }printf("\n"); } 程序运行后的输出结果是()。
A.ABCDEF
B.AbCdEf
C.aBcDeF
D.abcdef