码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2020-02-13 14:37:16      阅读:56      评论:0      收藏:0      [点我收藏+]

标签: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‘哦~

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

标签:ring   std   cpp   战争   for   clu   ios   code   细节   

原文地址:https://www.cnblogs.com/xiao-l-xiao-s/p/12303288.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!