int string相互转换

string stream1(ll i)
{
    stringstream stream;
    streami; return stream.str();
}//int数字转字符串 ll stream2(string str)
{
    ll x = 0;
    stringstream ss;
    ssstr;
    ss>>x; return x;
}
#include  #define ll long long using namespace std; int main()
{ string t = "123456789";
    stringstream ss(t); int A;
    ss>>A;
    coutendl; int t2 = 123456789;
    stringstream sss;
    ssst2;
    coutendl; return 0;
}
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务