下列程序如果输入an anple,该程序的输出结果是( )。#include #includeusing namespace std;void inverse(char str[ ]){ char t; int i, j; for(i=0, j=strlen(str);i>str; inverse(str); cout<
A. an anple
B. elpna na
C. an
D. na
查看答案
下列程序的运行结果是( )。 #include using namespace std;int *sum( int n ){ int s=0; for (int i=1; i<=n; i++) s+=i; return &s;}int main( ){ int n=9, *total; total=sum(n); cout<
A. 9
B. 10
C. 45
D. 55
要求函数的功能是交换x和y中的值,且通过正确调用返回交换结果。能正确表示此功能的函数是( )。
A. void funa(int *x, int *y) { int *p; *p = *x; *x = *y, *y = *p; }
B. void funb(int x, int y) { int t; t = x; x = y; y = t; }
C. void func(int *x, int *y) { *x = *y; *y = *x; }
D. { *x = *x + *y; *y = *x - *y; *x = *x - *y; }
下列程序的运行结果是( )。 #include using namespace std;void fun(int *a, int *b){ int *k; k=a; a=b; b=k;}int main(){ int a=3, b=6, *x=&a, *y=&b; fun(x,y); cout<
A. 6 3
B. 3 6
C. 编译出错
D. 0 0
以下程序的输出结果是( )。 #include using namespace std;int func(int a, int b){ int c; c = a+b; return c;}int main( ){ int x=6, y=7, z=8, r; r = func((x--,y++,x+y), z--); cout<
A. 11
B. 20
C. 21
D. 31