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:有人解释下我的程序为什么对吗?莫名其妙地过了...

Posted by 0810311106 at 2009-08-25 16:45:53 on Problem 2719 and last updated at 2009-08-25 16:59:34
In Reply To:有人解释下我的程序为什么对吗?莫名其妙地过了... Posted by:zjx20 at 2008-06-17 23:06:54
> 
> char n[10]
> gets(n)
> r=0   //结果
> len=strlen(n)
> for(i=0;i<len;i++)
> {
> 	p=n[i]-'0';
> 	if(p>4) p--;
> 	r += r*8+p;
> }



解释:这题本来就相当于9进制转换成十进制,你这不就是九进制的转换过程吗(不过你这个r*8不知道是怎么对的)?
我无语,你不知道原理还做出来了(而且有问题)。你才是万中无一的高手啊

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