string s;
cout << s[s.length()-1] << endl;
s长度为零有问题
另外一种
string s;
char c=s.back();
string s;
cout << *s.rbegin() << endl;
string s;
cout << s[s.length()-1] << endl;
s长度为零有问题
另外一种
string s;
char c=s.back();
string s;
cout << *s.rbegin() << endl;
C语言 输出一个字符
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M