以下程序运行后,输出结果是()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.8B.7C.6D.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


相似考题
更多“以下程序运行后,输出结果是()#include<stdio.h>ss(char*s){char*p=s; while(*p)p++ return(p-s); ”相关问题
  • 第1题:

    请读程序: 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

  • 第2题:

    以下程序运行后的输出结果是______。 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

  • 第3题:

    【填空题】写出下面程序执行后的运行结果。 #include <iostream> #include <string> using namespace std; char* ss____ { char*p, t; p = s + 1; t = *s; while ____ { *____ = *p; p++; } *____ = t; return s; } void main____ { char *p, str[10]="abcdefgh"; p = ss____; cout << p; }


    a=1,b=111

  • 第4题:

    以下程序的输出结果是()。includeint fun (char*s){char *p=s;while (*p!='\0,) p++

    以下程序的输出结果是( )。 #include<iostream.h> int fun (char*s) { char *p=s; while (*p!='\0,) p++: return (p-s): } void main() { cout<<fun (" ABCDEF ")<<endl: }

    A.3

    B.6

    C.8

    D.0


    正确答案:B

  • 第5题:

    【单选题】当运行以下程序时,从键盘输My Book<回车>,则下面程序的运行结果是()。 #include <stdio.h> char fun(char *s) { if(*s<='Z'&&*s>='A') *s+=1; return *s; } int main() { char c[80],*p=c; gets(c); while(*p) { *p=fun(p); putchar(*p); p++; } printf("n"); return 0; }

    A.mZ bPPk

    B.my book

    C.Ny Cook

    D.My Book


    v0=13,v1=4,v2=12