有以下程序:#include<stdio.h>main(){int a [10]={1,2,3,4,5,6,7,8,9,10},*p=&a[3], *q=p+2;
有以下程序: #include <stdio.h> main() { int a [10]={1,2,3,4,5,6,7,8,9,10},*p=&a[3], *q=p+2; prinff("%d\n";*p+*q); } 程序运行后的输出结果是()。
A.16
B.10
C.8
D.6
有以下程序: #include <stdio.h> main() { int a [10]={1,2,3,4,5,6,7,8,9,10},*p=&a[3], *q=p+2; prinff("%d\n";*p+*q); } 程序运行后的输出结果是()。
A.16
B.10
C.8
D.6
有以下程序: #include <stdio, h>int a =2;int f(int n){ static int a: 3; int t=0; if(n%2){ static int a=4;t+ =a++;} else { static int a=5;t+ :a++;} return t + a + +;main (){ int s=a,i; for(i=0;i<3;i++)s + =f(i); prinff("% d \n" ,s); }程序运行后的输出结果是()。
A.26
B.28
C.29
D.24
下面程序的功能是将小写字母变成对应大写字母后的第二个字母。其中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 a=7;
while(a--);
printf("%d\n",a);
}
程序运行后的输出结果是
A.-1
B.0
C.1
D.7
有以下程序
#include<stdio.h>
#include<string.h>
main()
{char str[][20]={“Qne*World”,“one*Dream!”},*P=str[1 ].
prinff(“%d,”,strlen(p));printf(“%s\n”,P); ’
}
程序运行后的输出结果是
A.9,One*World S)
B.9,One*Dream!
C.10,One*Dream!
D.10,One*World
有以下程序 #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. h> main () { char a :'a',b; printf("% c," , + + a); printf("%c \n" ,b =a++); }程序运行后的输出结果是()。
A.b,b
B.b,c
C.a,b
D.a,c
有以下程序#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.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