mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
37 lines
762 B
C++
37 lines
762 B
C++
|
#include<iostream>
|
||
|
#include<string>
|
||
|
using namespace std;
|
||
|
int main()
|
||
|
{
|
||
|
int n;
|
||
|
while(cin>>n)
|
||
|
{
|
||
|
string temp;
|
||
|
while(n--)
|
||
|
{
|
||
|
cin>>temp;
|
||
|
auto b=temp.begin();
|
||
|
if(*b=='-')
|
||
|
{
|
||
|
cout<<'-';
|
||
|
temp.erase(b);
|
||
|
}
|
||
|
int c=0;
|
||
|
auto d=temp.crbegin();
|
||
|
for(;d!=temp.crend();++d)
|
||
|
{
|
||
|
if(*d=='0')
|
||
|
c++;
|
||
|
else
|
||
|
break;
|
||
|
}
|
||
|
for(d;d!=temp.crend();++d)
|
||
|
cout<<*d;
|
||
|
for(int i=0;i!=c;++i)
|
||
|
cout<<'0';
|
||
|
cout<<endl;
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|