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 hchxiang at 2010-05-20 13:36:04 on Problem 3748
#include <cstdio>
#include <iostream>


int main()
{
	unsigned int r, x, y;

	//scanf("%x,%d,%d", &r, &x, &y);

std::cin>>std::hex>>r;
std::cin.get();
std::cin>>x;
std::cin.get();
std::cin>>y;

	r&=~(1L<<x);
	r|=6L<<(y-2);
	r&=~(1L<<(y-2));
	std::cout<<std::hex<<r;
	return 0;
}

两种输入方式,为什么这种总说答案错误,注释掉的c方式结果正确?
我用自己的编译器得到的结果是一样的

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