转为string 做

数字颠倒

http://www.nowcoder.com/questionTerminal/ae809795fca34687a48b172186e3dafe

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
    string str;
    int a;
    cin>>a;
    str=to_string(a);
    reverse(str.begin(),str.end());
    cout<<str<<endl;


    return 0;
}
全部评论

相关推荐

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