有下列程序 program test(input,output); var s:integer; ch:char; count:array[‘a‘..‘z‘]of integer; begin for ch:=‘a‘to‘z‘do count[ch]:=0; read(ch); while not eoln do begin if(ch>=‘a‘)and(chx[5])and(x[c]/c0) or not(x[a+b]>(a+b))的值是( )。AtrueBfalseC0D1

题目

有下列程序 program test(input,output); var s:integer; ch:char; count:array[‘a‘..‘z‘]of integer; begin for ch:=‘a‘to‘z‘do count[ch]:=0; read(ch); while not eoln do begin if(ch>=‘a‘)and(chx[5])and(x[c]/c0) or not(x[a+b]>(a+b))的值是( )。

Atrue

Bfalse

C0

D1


相似考题
更多“有下列程序 program test(input,output); var s:integer; ch:char; count:array[‘a‘..‘z‘]of ”相关问题
  • 第1题:

    有以下程序: include void funl (char * p){char * q; q=p; while( *q! ='\0') } (*q)

    有以下程序: #include <stdio.h>void funl (char * p){ char * q; q=p; while( *q! ='\0') } (*q) ++;q++;}mains( ){ char a[ ] = { "Program" } , * p; p = &a[3]; fun1 (p); printf("% s \n" ,a);}程序执行后的输出结果是( )。

    A.Prohsbn

    B.Prphsbn

    C.Progsbn

    D.Program


    正确答案:A
    解析:在main函数中,p=&a[3]说明指针p指向a数组的第4个字符(即字符'g');fun1中的q=p意味着指针q也指向了a数组的第4个字符。执行while语句,表达式(*q)++使'g'+1,使'g'变成了'h';表达式q++使q指向a[4]的起始地址。继续执行while语句,直到遇到'\0'结束循环,返回形参。最终得到的结果是从字符串"Program'的第4个字符开始,每个字符加1。

  • 第2题:

    程序段intcount=0;char*s=”ABCD”;while(*s!=’/0’){s++;count++;}执行后count=()。
    4

  • 第3题:

    以下选项中,不属于IPO模式一部分的是

    A.Output (输出)

    B.Input (输入)

    C.Process (处理)

    D.Program (程序)


    A

  • 第4题:

    有以下程序: void funl(char*p) { char*q; q=P; while(*q!=\O) {(*q)++;q++;} } main { char a[]={"Program"),*P; p=&a[3];funl(p); printf("%s\n",a); } 程序执行后的输出结果是( )。

    A.Prohsbn

    B.Prphsbn

    C.Progsbn

    D.Program


    正确答案:A
    本题中使用了函数的调用,由{unl函数中的while循环可知,循环的作用是为了把q所指向的内容增加l,而从主函数传到函数时是从下标为3开始传,因此当调用函数执行完后,传过去的字符串为hsbn,前面不变。

  • 第5题:

    以下选项中,不属于IPO模式一部分的是()。

    A.Output (输出)

    B.Process (处理)

    C.Program (程序)

    D.Input (输入)


    A