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

输出导致wa,请帮忙看看哪里错了

Posted by zeusliu at 2010-05-31 17:24:41 on Problem 3748
如果用printf("%x",ans)就可以ac,但是自己写的10进制到16进制的输出就错了…… 
:(

char Dec2Hex(int t)
{
	return t<10?'0'+t:'a'+(t-10);
}
void p(int n)
{
	if (n/16)
	{
		p(n/16);
	}
	printf("%c",Dec2Hex(n%16));
}
main()
{
        ........

	p(ans);printf("\n");    
    
        ....

}

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