首页 试题详情
单选题

阅读下面代码,输出结果为() int main() { char str1[] = "abc"; char str2[] = "abc"; const char str3[] = "abc"; const char str4[] = "abc"; const char *str5 = "abc"; const char *str6 = "abc"; cout

A true false true

B false true true

C false false false

D false false true

正确答案:A (备注:此答案有误)

相似试题

  • 单选题

    下面代码输出结果int func(int x) { int countx =0; while(x) { countx ++; x = x&(x-1); } return countx; }int main(){ cout

    答案解析

  • 单选题

    阅读下面代码输出结果int main(){ char str1[] = abc; char str2[] = abc; const char str3[] = abc; const char str4[] = abc; const char *str5 = abc; const char *str6 = abc; cout

    答案解析

  • 问答题

    ;}【代码3】#include<stdio.h>int main(){ int i,j,k; for(i=0; i<2; i++) for(j=0; j<3;j++) for( k=0; k<2;k++) { if(i!=j&&j!=k) printf(%d %d %d n, i,j,k); } ruturn 0;} 问题:3.1 (4分)对于代码1,写出下面的函数调用后x1 、x2、x3和x4的值。x1 = f(1997);x2 = f(2000);x3 = f(2100);x4 = f(2020); 问题:3.2 (5分(1写出代码2进行时输入3的输出结果;(2写出代码2进行时输入5的输出结果。 问题:3.3 (6分写出代码3运行后的输出结果

    答案解析

  • 问答题

    if(______)sum++; return sum; }[说明2]将下面C代码2中的空缺补全后运行,使其产生以下输出。f2:f2:f2:2 f3:f3:1 [C代码2] #include<stdio.h> int f1(int(*f)(int)); int f2(int); int f3(int); int main() { printf(%d n,f1(______)); printf(%d n,f1(______)); return 0; } int f1(int(*f)(int)) { int n=0; /*通过函数指针实现函数调用,以返回值作为循环条件*/ while (______) n++; return n; } int f2(int n) { printf(f2:); return n*n-4; } int f3(int n) { printf(f3:); return n-1;

    答案解析

  • 单选题

    阅读下马代码,运行结果class cls{public: int mi ; cls(int i):mi(i) { mi = i; cout

    答案解析

热门题库