• 2022-06-09
    #include struct ab { char a[5]; float b; }; void main() { ab x={"Li",89.6}; cout
  • Li 89.6

    内容

    • 0

      以下程序段的运行结果是( )。 char x&#91;5&#93;={'a', 'b', '\0', 'c', '\0'}; cout<<x; A: 'a''b' B: ab C: ab c D: abc

    • 1

      运行程序,程序输出结果是( )#include using namespace std;int main(){ struct stud{ char num &#91;5&#93;; int s&#91;4&#93;; double ave;} a;cout A: 31 B: 32 C: 29 D: 30

    • 2

      阅读下面程序: #include<iostream.h> void fun1(char a,char b) { char c; c=a;a=b;b=c; } void fun2(char &a,char &b) { char c; c=a;a=b;b=c; } void main() { char a,b; a=’x’;b=’y’; fun1(a,b);cout<<a<<b; a=’x’;b=’y’; fun2(a,b);cout<<a<<b; } 则该程序的输出为______。

    • 3

      以下程序执行结果是()。 #include #include void main() { char s1&#91;10&#93;,*s2="ab\0cdef"; strcpy(s1,s2); printf("%s",s1); } A: ab\0cdef B: abcdef C: a D: 以上答案都不对

    • 4

      有以下程序段,输出结果为()。#include<stdio.h>struct student{int num;char name&#91;20&#93;;float score;};main(){struct student stu&#91;5&#93;;printf("%d",sizeof(stu));} A: 140 B: 160 C: 5 D: 随机值