Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:应该是这样输出的 ,小弟认为 下面的程序AC了 ^ - ^

Posted by acm1985 at 2006-04-25 16:47:14 on Problem 2719
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator