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

这个测试数据怎么感觉有点错啊!

Posted by jlkjxy_shilifeng at 2010-07-25 15:18:42 on Problem 3748
#include <stdio.h>

#define setbit(x,y) x|=(1<<(y)) 
#define clrbit(x,y) x&=~(1<<(y)) 

int main()
{
	int r, x, y;
	scanf("%x,%d,%d", &r, &x, &y);
	clrbit(r, x);
	setbit(r, y);
	setbit(r, y - 1);
	clrbit(r, y - 2);
	printf("%x\n", r);
	return 0;
}
这个程序,我用题目中给出的数据来测试,答案跟上面的不一样,这个答案只能显示4位,可为什么提交上去是对的啊??为什么??我自已写的程序,跟答案是对的,可为什么会不成功呢?

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