题库 / 3030807. 读代码:if 判断(2024-12)
3030807. 读代码:if 判断(2024-12)
题目描述
下列程序输出的是()
string ch="hello";
if(ch[5]==NULL)
{
cout<<"right"<<endl;
}
else if (ch[5]=='\0')
{
cout<<"wrong"<<endl;
}
else
{
cout<<"hello"<<endl;
}
作答说明
单选题:在选项里选出唯一正确的一项,提交后立即判定。答对得满分,答错可以重新提交(两次提交之间需要间隔 20 秒)。
题目来源
CCF GESP 2024 年 12 月认证 C++ 3 级试题,第 9 题。