#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ if(n==0){ // 如果n等於 0 cout<<"0"<<endl; continue; // 繼續下一次迴圈 } if(n<0){ // 如果n是負數 cout<<"-"; // 輸出負號 n=abs(n); // 將n轉換為正數 } int count=0,temp=0; // 初始化計數器count和暫存變數temp while(n>=1){ // 當n大於或等於1時進入迴圈 temp=n%10; // 取得n的最後一位數字 n/=10; // 將n除以10,去掉最後一位數 if(temp!=0||count!=0){ // 如果temp不為0或已經有非零位數 cout<<temp; count++; // 增加計數器 } } cout<<endl; } return 0; }