#21618: c++ string


ivy14285@gmail.com (tytytyty)

學校 : 高雄市立高雄女子高級中學
編號 : 82616
來源 : [42.72.190.98]
最後登入時間 :
2023-12-25 16:08:07
a038. 數字翻轉 | From: [59.127.225.183] | 發表日期 : 2020-06-28 10:30

#include<bits/stdc++.h>

using namespace std;

int main(){

    string s;cin>>s;

    reverse(s.begin(),s.end());

    int t=s.find_first_not_of('0');

    if(t>=s.size())cout<<0<<endl;

    else cout<<s.substr(t)<<endl;

}

 

 
ZeroJudge Forum