(38)有以下程序#include <stdio.h>struct S{ int a,b;}data[2]={10,100,20,200};main(){ s
(38)有以下程序
#include <stdio.h>
struct S
{ int a,b;}data[2]={10,100,20,200};
main()
{ struct S p=data[1];
printf("%d\n",++(p.a));
}
程序运行后的输出结果是
A)10
B)11
C)20
D)21
(38)有以下程序
#include <stdio.h>
struct S
{ int a,b;}data[2]={10,100,20,200};
main()
{ struct S p=data[1];
printf("%d\n",++(p.a));
}
程序运行后的输出结果是
A)10
B)11
C)20
D)21
有以下程序: #include <iostream> #include <string> using namespace std; int main () { char s[]="\n123\\"; cout<<strlen (s) <<", "<<sizeof (s) <<end1; return 0; }
A.赋初值的字符串有错
B.6,7
C.5,6
D.6,6
有以下程序: #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>
#define S(x) (x)*x*2
main()
{ int k=5, j=2;
printf("%d,”,s(k+j) ); printf(”%d\n”,s((k-j) ) );
}
程序运行后的输出结果是
A) 98,18
B) 39,11
C) 39,18
D) 98,11
有以下程序
#include<stdio.h>
void fun(char**p)
{++p;printf("%s",*p);}
main
{char*a[]={"Morning","Afternoon","Evening"," Night");
fun(a);
}
程序的运行结果是()。
A.Afternoon
B.fternoon
C.Morning
D.orning
有以下程序:
#include<stdio.h>
struct S
{int a,b;)data[2]=10,100,20,200);
main()
{struct S p=data[l];
printf("%d\n",++(p.a));
}
程序运行后的输出结果是()。
A.10
B.11
C.20
D.21
有以下程序: #include<stdio.h> main { char s[]="rstuv"; printf("%c\n",*s+2); } 程序运行后的输出结果是()。
A.tuv
B.字符t的ASCIl码值
C.t
D.出错
有以下程序: #include<stdio.h> #define S(x)4*(x)*x+1 main() {int k=5,j=2; printf("%d\n",S(k+j)); } 程序运行后的输出结果是()。
A.197
B.143
C.33
D.28
有以下程序
#include<stdio.h>
void fun(char **p)
{
++p; printf(“%s\n”,*p);
}
main()
{
char *a[]={“Morning”,”Afternoon”,”Evening”,”Night”};
fun(
A.;
}
程序的运行结果是()。
A.Afternoon
B.fternoon
C.Morning
D.orning
有以下程序:#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<iostream> using namespace std; class sample { private: int x; public: sample(int A) { x=a; friend double square(sample s); }; double square(sample s) { return S.X*S.K; } int main() { sa
A.20
B.30
C.900
D.400