下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]=""Hello,World"; char*ptr = a;

admin2009-01-15  17

问题 下列程序的输出结果是(    )。    #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

答案1

解析
转载请注明原文地址:https://kaotiyun.com/show/S4kp777K
0

最新回复(0)