题解 | #反序输出#

反序输出

https://www.nowcoder.com/practice/171278d170c64d998ab342b3b40171bb

#include <algorithm>
#include <iostream>
using namespace std;
#include<string>

int main() {
    string str;
    while (cin >> str) { // 注意 while 处理多个 case

        reverse(&str[0],&str[4]);	//C++自带的翻转函数 注意头文件 <algorithm>
        cout <<str<< endl;
    }
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务