设有如下程序#include<stdio.h>main(){int **k, *j,i=100;j=&i; k=&j;printf("%d\n"”,**
设有如下程序 #include<stdio.h> main() { int **k, *j,i=100; j=&i; k=&j; printf("%d\n"”,**k); } 上述程序的输出结果是______。
A.运行错误
B.100
C.i的地址
D.j的地址
设有如下程序 #include<stdio.h> main() { int **k, *j,i=100; j=&i; k=&j; printf("%d\n"”,**k); } 上述程序的输出结果是______。
A.运行错误
B.100
C.i的地址
D.j的地址
第1题
以下程序运行后的输出结果是【 】。 include <stdio, h> main() char c1 ,c2; for(el = 0, c2 =9; e1<c2; c1 + + , c2 -- ) printf(" %c%c", c1, c2 ); printf("\n" ); }
第2题
请补充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);
}
}
第3题
有以下程序: #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
第4题
下面程序的功能是将小写字母变成对应大写字母后的第二个字母。其中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);
}
错误:______
改正:______
参考答案:错误
第5题
设有下列程序: include<stdio.h> include<string.h> main() { int i; char s[10],t[10]; gets(t); for(i=0;i<2;i++) {gets(s); if(strcmp(t,s)<0) strcpy(t,s); } printf("%s\n",t); } 程序运行后,从键盘上输入(<CR>代表回车符):CDEF<CR>BADEF<CR>QTHRG<CR>,则程序的输出结果是______。
第6题
若有如下程序: include "stdio.h" main() { char s[30]; Strcpy(&S[0],"adc"); Strcpy(&S[1],"def"); strcpy(&S[2],"gh");; printf("%S\n",s); 则程序运行后的输出结果是【 】。
第7题
A.0x11
B.11
C.17
D.%d
第8题
若有如下程序: include"stdio.h" main() {char s[30]; strcpy(&s[0],"abc"); strcpy(&s[1],"de"); strcpy(&s[2],"f"); printf("%s\n",s); } 则程序运行后的输出结果是【 】。
第9题
A.011
B.11
C.9
D.%d
第10题
有如下程序: #include<iostream> using namespace std; class B{ public: Virtual void show(){cout<<“B”;} }; class D:publicB{ public: void show(){cout<<“D”;} }; void funl(B*ptr){ptr->show();} void{un2(B&ref){ref.show();} void
A.BBB
B.BBD
C.DBB
D.DBD
第11题
A.=0
B.=1
C.=2
D.=3