我前面明明有寫一個if
判斷輸入的值是否只有一個0
而且我自己跑也沒有問題
為甚麼丟上來跑就不會過QAQ
#include <iostream>
#include<string>
using namespace std;
int main()
{
string s;
while(cin>>s)
{
int i=s.length()-1;
bool is_first=false;
if(i==0 && s[0]=='0')
{
cout<<'0';
}
else
{
while(!is_first)
{
if(s[i]!='0')
{
cout<<s[i];
is_first=true;
}
i--;
}
while(i>=0)
{
cout<<s[i];
i--;
}
}
cout<<endl;
}
return 0;
}