【题解】战争系列-截获密文I

给你一个最短代码:

#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'哦~

posted @ 2020-02-13 13:20  SD!LTF  阅读(188)  评论(5编辑  收藏  举报