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 00448264 at 2006-01-13 17:33:32 on Problem 2174
In Reply To:请高手帮我看一下WA的原因啊,多谢了 Posted by:Gamme at 2006-01-13 17:30:09
#include<stdio.h>
#include<string.h>
unsigned char space[20100],nospace[20100];
int main()
{
	int len,i;
	unsigned char key,clear;
	//freopen("in.txt","r",stdin);
	scanf("%s",nospace);
	scanf("%s",space);
	len=strlen(nospace);
	for(i=0;i<=len-1;i++)
	{
		if (nospace[i]>='0'&&nospace[i]<='9')
			nospace[i]-='0';
		else nospace[i]=nospace[i]-('A'-10);
	}
	for(i=0;i<=len-1+2;i++)
	{
		if (space[i]>='0'&&space[i]<='9')
			space[i]-='0';
		else space[i]=space[i]-('A'-10);
	}
	len/=2;
	for(i=0;i<=len-1;i++)
		nospace[i]=nospace[i*2]*16+nospace[i*2+1];
	for(i=0;i<=len;i++)
		space[i]=space[i*2]*16+space[i*2+1];
	clear=' ';
	for(i=0;i<=len-1;i++)
	{
		key=space[i]^clear;
		clear=nospace[i]^key;
		printf("%02X",(int)key);
	}
	key=space[i]^clear;
	printf("%02X\n",key);
	return 0;
}

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