对下述程序的判断中,正确的是includevoid main(){char*p,s[128];p=S;while(strcmp(s,"对下述程序的判断中,正确的是 #include<stdio.h> void main() { char*p,s[128]; p=S; while(strcmp(s,"End")) { printf("Input a string:");gets(s); while(*p) putchar(*p++);}}A.此程序循环接收字符串并输出,直到接收字符串"End"为止B.此程序

题目
对下述程序的判断中,正确的是includevoid main(){char*p,s[128];p=S;while(strcmp(s,"

对下述程序的判断中,正确的是 #include<stdio.h> void main() { char*p,s[128]; p=S; while(strcmp(s,"End")) { printf("Input a string:");gets(s); while(*p) putchar(*p++);}}

A.此程序循环接收字符串并输出,直到接收字符串"End"为止

B.此程序循环接收字符串,接收到字符串"End"则输出,否则程序终止

C.此程序循环接收字符串并输出,直到接收字符串"End"为止,但因为代码有错误,程序不能正常工作

D.此程序循环接收字符串并将其连接在一起,直到接收字符串"End"为止,输出连接在一起的字符串


相似考题
更多“对下述程序的判断中,正确的是#include<stdio.h>void main(){char*p,s[128];p=S;while(strcmp(s," ”相关问题
  • 第1题:

    以下程序的输出结果是______。includeincludefun(char *w,int n){ char t,*

    以下程序的输出结果是______。 #include<stdio.h> #include<siring.h> fun(char *w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char *p; p="1234567"; fun(p,strlen(p)); puts(p); }

    A.1234567

    B.7654321

    C.1711717

    D.7177171


    正确答案:C
    解析:在子函数fun中,s1为字符串w的起始地址,s2为字符串的结束地址(字符'\0'除外),当执行循环结束循环,w=“1711717”。

  • 第2题:

    请读程序: includef(char * s){cahr * p=s;while(* p!='\0')p++;return(p-s);}main(){

    请读程序: # include<stdio.h> f(char * s) {cahr * p=s; while(* p!='\0')p++; return(p-s); } main() {printf("%d\n”,f("ABCDEF"));} 上面程序的输出结果是 ( )

    A.3

    B.6

    C.8

    D.0


    正确答案:B

  • 第3题:

    下面程序的运行结果是______。 include include fun(char*w,int n) { char

    下面程序的运行结果是______。 #include<stdio.h> #include<string.h> fun(char*w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1; while(s1<s2) {t=*s1++;*s1=*s2--;*s2=t;} } main() { char*p; p="1234567"; fun(p,strlen(p)); puts(p); }

    A.7654321

    B.1714171

    C.1711717

    D.7177171


    正确答案:C

  • 第4题:

    以下程序运行后,输出结果是______。includess(char*s){char *p=s; while(*.p)p++; retu

    以下程序运行后,输出结果是______。#include<stdio.h>ss (char *s){ char *p=s; while(*.p)p++; return(p-s);}main(){ char *a="abded"; int i; i=ss((A); print ("%d\n",i);}

    A.8

    B.7

    C.6

    D.5


    正确答案:D

  • 第5题:

    以下程序运行后,输出结果是()includess(char*s){char*p=s; while(*p)p++ return(p-s);

    以下程序运行后,输出结果是( ) #include<stdio.h> ss(char *s) { char*p=s; while(*p) p++ return(p-s); } main() { char *a="abded" int i; i=ss(a) ; printf("%d\n",i); }

    A.8

    B.7

    C.6

    D.5


    正确答案:D