#11505: 數字翻轉c++答案


benny28889848 (benny28889848)

學校 : 雲林縣正心高級中學
編號 : 61790
來源 : [163.27.231.246]
最後登入時間 :
2017-10-13 12:50:07
a038. 數字翻轉 | From: [163.27.231.14] | 發表日期 : 2016-11-10 11:48

#include<stdio.h>
#include<stdlib.h>
int main()
{
int n,nc,ncx,ncif=0;
while(scanf("%d",&n)!=EOF)
{
nc=n;
for(; nc>0; )
{
ncx=nc%10;
nc=nc/10;
ncif=ncif+ncx;
if(ncif>0)
{
printf("%d",ncx);
}
}
if(n==0)
{
printf("0");
}
printf("\n");
}
}

 
#12716: Re:數字翻轉c++答案


yumi0807bb@gmail.com (陳曉萱)

學校 : 不指定學校
編號 : 69678
來源 : []
最後登入時間 :
2017-09-20 11:59:14
a038. 數字翻轉 | From: [27.247.12.76] | 發表日期 : 2017-09-20 12:06

#include
#include
int main()
{
int n,nc,ncx,ncif=0;
while(scanf("%d",&n)!=EOF)
{
nc=n;
for(; nc>0; )
{
ncx=nc%10;
nc=nc/10;
ncif=ncif+ncx;
if(ncif>0)
{
printf("%d",ncx);
}
}
if(n==0)
{
printf("0");
}
printf("\n");
}
}


不好意思想請問EOF是什麼意思?

 
#14917: Re:數字翻轉c++答案


reina42689 (職業岩龍騎手)

學校 : 國立澎湖科技大學
編號 : 77774
來源 : [59.125.177.63]
最後登入時間 :
2024-12-12 10:46:39
a038. 數字翻轉 | From: [114.45.63.34] | 發表日期 : 2018-08-14 18:05

(略)


不好意思想請問EOF是什麼意思?



end of file: 資料尾端

 
ZeroJudge Forum