A-A+

阅读下列程序 写出程序的运行结果【 】。 include<iostream. h> void

2022-08-05 20:26:14 问答库 阅读 171 次

问题详情

阅读下列程序,写出程序的运行结果【 】。
include<iostream. h>
void main() { char str1[ ]: "Hello, World?;
char str2[100];
int i=0;
do{
if (str1[i]>= "a"&& str1[i]<= "z" )
str2[i]=str1[i]-32;
else
str2[i]=strl [i];
i++;
}while(strl[i]!="");
str2[i]="";
cout<<str1<<end1;
cout<<str2<<end1;
}请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:Hello World!HELLO WORLD!
Hello, World!HELLO, WORLD!

考点:程序,结果