想看題目請點我
#include<iostream> using namespace std; int main() { string x; while(cin >> x) { for(int i = 1 , flag = 0 ; i<= x.length() ; i++ ) { if((flag==0) && x[x.length()-i] == '0') continue; else flag = 1 ; if(flag = 1) cout << x[x.length()-i] ; } cout << endl ; } return 0; }