关于stringstream
  • 板块学术版
  • 楼主hoyoo
  • 当前回复3
  • 已保存回复3
  • 发布时间2020/11/13 20:24
  • 上次更新2023/11/5 08:09:05
查看原帖
关于stringstream
370419
hoyoo楼主2020/11/13 20:24
#include<bits\stdc++.h>
using namespace std;
int main()
{
    int a;
    cin>>a;string res;
    stringstream ss;
    for(int i=a;i>0;i--)
    {
        ss << i;
        ss >> res;
         cout<<res;
    }
    return 0;
}

为什么字符串不随着i变化?

2020/11/13 20:24
加载中...