单选题有以下程序: #include main() {char a[30],b[30];scanf(%s,a);gets(b);printf(%s%s,a,b); } 程序运行时若输入: how are you?I am fine<回车> 则输出结果是(  )。A how are you? <换行>I am fineB how<换行> are you? I am fineC how are you? I am fineD how are you?

题目
单选题
有以下程序: #include  main() {  char a[30],b[30];  scanf(%s,a);  gets(b);  printf(%s%s,a,b); } 程序运行时若输入: how are you?I am fine<回车> 则输出结果是(  )。
A

how are you? <换行>I am fine

B

how<换行> are you? I am fine

C

how are you? I am fine

D

how are you?


相似考题
更多“单选题有以下程序: #include main() {  chara[30],b[30];  scanf(%s,a);  gets(b);  printf(%s%s,a,b); } 程序运行时若输入: howareyou?Iamfine回车 则输出结果是(  )。A how are you? 换行I am fineB how换行 are you? I am fineC how are you? I am fineD how are you?”相关问题
  • 第1题:

    有以下程序

    #include <stdio.h>

    main()

    { char a[20]="How are you?",b[20];

    scanf("%s",b); printf("%s %s\n",a,b);

    }

    程序运行时从键盘输入: How are you?< 回车 >

    则输出结果为 【 1 3 】 。


    正确答案:

  • 第2题:

    I am really fed up with Larry!_____________

    A.How is she

    B.Are you OK?

    C.Why do you say that


    参考答案:C

  • 第3题:

    ________ is what I am anxious to know.

    A、How do you get rid of mice

    B、How you get rid of mice

    C、How can you get rid of mice

    D、How could you get rid of mice


    参考答案:B

  • 第4题:

    - How are you, Bob? - ___________ Ted.

    A、How are you?

    B、I am fine, thank you.

    C、How do you do?

    D、Nice to meet you.


    正确答案:B

  • 第5题:

    有以下程序 #include<stdio.h> main( ) {char a[3O],b[30]; scanf("%S",a); gets(b); printf("%s\n%s\\n",a,b); } 程序运行时若输入: how are you? I am fine<回车> 则输出结果是( )。

    A.how are you? I am fine

    B.how are you?I am fine

    C.how are you?I am fine

    D.how are you?


    正确答案:B
    此题主要考查scanf函数和gets函数的区别。答案为B。

  • 第6题:

    有以下程序

    include<stdio.h>

    main()

    {char a[30],b[30];

    scanf(“%s”,a);

    gets(b);

    printf(“%s\n%s\n”,a,b);

    }

    程序运行时若输入:

    how are you? I am fine<回车>

    则输出结果是

    A.how are you? I am fine

    B.how are you? 1 am fine

    C.how are you? I am fine

    D.how are you?


    正确答案:B

  • 第7题:

    (31)有以下程序

    #include <stdio.h>

    main()

    { char a[30],b[30];

    scanf("%s",a);

    gets(b);

    printf("%s\n %s\n",a,b);

    }

    程序运行时若输入:

    how are you? I am fine<回车>

    则输出结果是

    A)how are you? B)how

    I am fine are you? I am fine

    C)how are you? I am fine D)row are you?


    正确答案:B

  • 第8题:

    How are you going on with your English?()

    • A、I am very well. 
    • B、I am going to the library. 
    • C、I am going to take College English Test Band Four. 
    • D、That's a good question

    正确答案:C

  • 第9题:

    How was your final exam?()

    • A、Take it easy.
    • B、You are right away.
    • C、I am not sure.  
    • D、Let's have a drink.

    正确答案:C

  • 第10题:

    单选题
    有以下程序:#include main(){ int i,j=0; char a[] = How are you,b[10]={0}; for(i=0;a[i];i++)  if(a[i]==' ')   b[j++]=a[i+1]; printf(%s,b);}程序运行后的输出结果是(  )。
    A

    Hay

    B

    How are you

    C

    we

    D

    ay


    正确答案: C
    解析:
    for语句循环体执行功能是,每次当a[i]元素为' '时,自动将a[i]下一个元素赋值给b[j],赋值完成后,j值加1,因此a[i]的'a'和'y'分别赋值给b[0],b[1],输出结果为ay。答案选择D选项。

  • 第11题:

    问答题
    A man is 36 years old. He asks the other man how old he is. The other man answers: “I am twice as old as you were when I was as old as you are today.” How old is the other man?

    正确答案: 48
    解析: 解答本题需要理解“I am twice as old as you were when I was as old as you are today.”,意思为:B男在A男这个年纪(36)时,B男年龄是当时A男年龄的两倍,假设B男年龄为x,则x=[36-(x-36)]*2=x,故x=48。

  • 第12题:

    单选题
    Stan: Thank you from the bottom of my heart for saving my little girl’s life.  John: ________.  Stan: I can’t tell you how much I appreciate what you’ve done.  John: I’m just happy I could help.
    A

    There’s nothing to be afraid of.

    B

    This is a wonderful day.

    C

    Anybody would have done the same.

    D

    I am glad to save her.


    正确答案: D
    解析:
    这是一道与文化有关的题,当你救了别人的命,别人对你表示感谢时,你应该用“任何人都会这样做”来谦虚地回答。A选项“没什么可怕的”不符合题意,B选项“今天很美好”不合题意,D选项“很高兴救了她的命”与John最后一句的回答重复。因此C项正确。

  • 第13题:

    --- __________?

    --- Yes, I am.

    A. What’s your name

    B. How old are you

    C. Are you married


    参考答案:C

  • 第14题:

    How are you feeling now? ()

    A. Oh, much better.

    B. I am very happy.

    C. It’s not important.

    D. So beautiful and sweet.


    参考答案:A

  • 第15题:

    A: How old are you? B: Yes, I am.()

    此题为判断题(对,错)。


    参考答案: 错误

  • 第16题:

    有以下程序

    jnclude<stdio.h>

    main( )

    {char a[20]=“How ale you?”,b[20];

    scanf(“%s”,B);pfinff(“%s%s\n”,a,B);

    }

    程序运行时从键盘输入:How are you?<回车>

    则输出结果为【 】。


    正确答案:How are you?How
    How are you?How 解析:用%s格式输入字符串时,空格和回车都做为输人数据的分隔符,不能被读入,因此数组b的输出结果为How。

  • 第17题:

    以下程序:includemain(){char str[10];scanf("%s",&str);printf("%s\n",str);}运

    以下程序: #include<stdio.h> main() {char str[10]; scanf("%s",&str); printf("%s\n",str); } 运行上面的程序,输入字符串how are you,则程序的执行结果是( )。

    A.how

    B.how are you

    C.h

    D.howareyou


    正确答案:A
    解析:当从键盘输入bow are you时,由于scanf输入函数的特点是遇到空格时结束读入字符,因此,该程序只将how这3个字符送到了字符数组str中,并在其后自动加上结束符“\0”。

  • 第18题:

    2.—How _______you?

    —I_______ fine, thanks.

    A.are;is

    B.are; am

    C.are;are

    D.is,am


    正确答案:B
    2.B[解析】人称不同对应be动词的形式不同,第一人称1对应am,第二人称you对应are,故选B。

  • 第19题:

    This is John.()

    • A、Oh, I have never seen you. 
    • B、Yes, I am glad.
    • C、Hello, John. Nice to meet you.
    • D、How are you?

    正确答案:C

  • 第20题:

    How are you,Bob?—greetings/How do you do?Hello!Hi!What’s up?()Ted

    • A、How   are   you?
    • B、I’m   fine.Thank  you.
    • C、How  do  you   do?
    • D、Nice   to   mee   tyou.

    正确答案:B

  • 第21题:

    常用的英语:当外国乘客说How do you do?的时候你应该回答什么?()

    • A、No 
    • B、I am fine
    • C、I don't know
    • D、I have no idea

    正确答案:B

  • 第22题:

    单选题
    有以下程序: #include  #include  main() {   int i;  char a[]=How are you!;  for(i=0;a[i];i++)  {   if(a[i]==' ')   {    strcpy(a,&a[i+1]);    i=0;   }  }  printf(%s,a); } 程序的运行结果是(  )。
    A

    you!

    B

    Howareyou!

    C

    areyou!

    D

    are you!


    正确答案: A
    解析:
    复制字符串函数strcpy(str1,str2),将str2完整的(包括'\0')复制到str1中,str1中原有的内容被覆盖。程序执行过程为:在a[i]不等于'\0'的情况下,判断当前元素是否为空格,若为空格将下一个元素以及之后的所有字符复制到a数组中。当i=3时,if条件成立,a以及之后单元中元素为"are you!\0",i=0,进行下一次循环,之后当i=3时,if条件成立,a以及之后单元中元素为"you!\0",i=0,之后的元素中在'\0'前没有空格出现,输出you!。答案选择A选项。

  • 第23题:

    单选题
    有以下程序:#include main(){ int i,j=0; char a[] = How are you!,b[10]={0}; for(i=0;a[i];i++)  if(a[i]==' ')   b[j++]=a[i-1]; printf(%s,b);}程序运行后的输出结果是(  )。
    A

    we

    B

    How are you!

    C

    ay

    D

    we!


    正确答案: D
    解析:
    for语句循环体执行功能是,每次当a[i]元素为' '时,自动将a[i-1]上一个单元内容赋值给b[j],赋值完成后,j值加1,因此a[i]的'w'和'e'分别赋值给b[0],b[1]。答案选择A选项。