#16381: 0 要記得省略


Murray_Colbert_is_the_Best (Your Dad's Best Friend)

學校 : 臺北市立金華國中
編號 : 89425
來源 : [140.122.107.220]
最後登入時間 :
2019-02-13 21:09:30
a038. 數字翻轉 | From: [140.122.107.218] | 發表日期 : 2018-12-26 20:51

#include<stdio.h>
int main(){
int n;

while(scanf("%d",&n)!= EOF){
if(n == 0){
printf("0\n");
continue;

}
while(n%10 == 0){
n=n/10;
}
while(n > 0){
printf("%d",n%10);
n = n/10;
}
printf("\n");
}

return 0;
}

 
#17282: Re:0 要記得省略


ufve0704 (爬 我爬 我爬爬爬 有排行榜這種東西就是要爬 爬過我上面的那...)

學校 : 臺北市私立延平高級中學
編號 : 83268
來源 : [203.72.178.1]
最後登入時間 :
2023-10-30 13:02:50
a038. 數字翻轉 | From: [114.42.217.205] | 發表日期 : 2019-04-01 21:50

#include
int main(){
int n;

while(scanf("%d",&n)!= EOF){
if(n == 0){
printf("0\n");
continue;

}
while(n%10 == 0){
n=n/10;
}
while(n > 0){
printf("%d",n%10);
n = n/10;
}
printf("\n");
}

return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main(int argc, char** argv){

ios::sync_with_stdio(false);

cin.tie(0);

int a,b;    

while(cin>>a){

b=0;    

while(a!=0){          

b=b*10+a%10;    

a/=10;    

cout<<b<<'\n';   

}

}

這樣..... 

 



 
ZeroJudge Forum