单选题

下面C++代码执行后不能输出"GESP"的是(   )。

A

string str("GESP"); cout<<str<<endl;

B

string str="GESP"; cout<<str<<endl;

C

string str("GESP"); cout<<str[1]<<str[2]<<str[3]<<str[4]<<endl;

D

string str{"GESP"}; cout<<str<<endl;

赣ICP备20007335号-2