标签:ring std cpp 战争 for clu ios code 细节
给你一个最短代码:
#include <iostream>
#include <string>
int main(){
std::string str;
std::cin >> str;
for(int i = str.length()-2;i >= 0; i--) std::cout << str[i];
}
小细节:str.length()-1
减掉的是‘\0‘
哦~
标签:ring std cpp 战争 for clu ios code 细节
原文地址:https://www.cnblogs.com/xiao-l-xiao-s/p/12303288.html