下列程序的输出结果是( )。 #included<iostream> usingnamespacestd; intmain() { chara[]="Hell0,Test"; char*p=a; while(*p) { if(*p>=a&&*p<=z) cout<<char(*p+A-a); elsecout<<*P; p++; } return0; }
A.hello,test
B.Hello,Test
C.HELLO,TEST
D.hELLO,tEST
第1题:
下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]="Hello,Test"; char *p=a; while(*p) { if(*p>='a'&&*p<='z') cout<<char(*p+'A'-'a'); else cout<<*p; p++; } return 0; }
A.hello,test
B.Hello,Test
C.HELLO,TEST
D.hELLO,tEST
第2题:
下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]="Hello,Test"; char*p=a; while(*p) { if(*p>='a'&&*p<='z') cout<<char(*p+'A'-'a'); else cout<<*p; p++; } re
A.hllo,test
B.Hello,Test
C.HELLO,TEST
D.hELLO,tEST
第3题:
下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]=""Hello,World"; char*ptr = a; while(*ptr) { if(*ptr>= 'a' &&*ptr<='z') cout<<char(*ptr+'A'-'a'); else cout<<*ptr; ptr++; } retur 0; }
A.HELLO, WORLD
B.Hello, World
C.HELLO, world
D.hello, world
第4题:
下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]="Hello,Test"; char *p=a; while(*p) { if(*p>='a'&&*p<='’z') cout<<char(*p+'A'-'a'); else cout<<*p; p++; } return 0; }
A.hello,test
B.Hello,Test
C.HELLO,TEST
D.hELLO,tEST
第5题:
下面程序输出的结果是( )。 #include<iostream> using namespace std; int fuc (char *x); int main(){ cout<<fuc("hello")<<endl; return 0; } int fuc(char *x){ char *y=x; while(*y! ='\0')y++; return(y-x); }
A.5
B.6
C.0
D.语法错误,不能输出结果
第6题:
下列程序的输出结果是 #include <iostream> using namespace std; int main () { char a [] = "Hello,World": char*ptr = a; while (*ptr) { if(*ptr>= 'a' &&*ptr <='z' cout<<char{*ptr+'A'-'a'); else cout<<*ptr; ptr++; } return 0; }
A. HELLO. WORLD
B. Hello, World
C. hELLO, wORLD
D. hello, world