求助,为啥我的0删不掉
查看原帖
求助,为啥我的0删不掉
1449927
cccckick楼主2024/12/9 22:30
#include <bits/stdc++.h>
using namespace std;
#define int long long
string a;
signed main()
{
	cin>>a;
	if(a[0]=='-')
	reverse(a.begin()+1,a.end());
	else
	reverse(a.begin(),a.end());
    while(a[0]=='0')
	  a.erase(0,1);
for(auto it: a)
	cout<<it;
	
}
2024/12/9 22:30
加载中...