Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:应该是这样输出的 ,小弟认为 下面的程序AC了 ^ - ^In Reply To:大虾的提醒使我茅塞顿开 但我用九进制写的程序还是RE,真不该怎么班!!!!还请大虾指点。。。(附程序) Posted by:toughcat at 2005-12-28 22:25:22 > #include<stdio.h> void main() { long int num,temp,duck,big; int b,i=0,x; while(1) { scanf("%ld",&num); if(num==0) break; temp=0; for(b=0,duck=10,big=1;b<9;b++) { x=(num%duck)/(duck/10); if(x>=0&&x<=3) temp+=x*big; else if(x>4&&x<=9) temp+=(x-1)*big; duck*=10; big*=9; } printf("%ld: %ld\n",num,temp); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator