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

为什么我的poj2913过不了?高手指教

Posted by kooler at 2009-06-21 22:04:26
http://poj.grids.cn/problem?id=2913


#include <stdio.h>
#include <string.h>
char a[1000];
char zh(int c)
{
	if (c<' ')
		return c+91;
	if (c>'z')
		return c-91;
	return c;
}
main()
{

	char w,b[8]="4962873";
	int i=0,j;
	scanf("%c",&w);
	while(w!='\n')
	{
		a[i]=w;
		scanf("%c",&w);
		i++;
	}
	a[i]='\0';
	i=0;
	for (j=0;j<strlen(a);j++)
	{
		a[j]=zh(a[j]+(b[i%7]-'0'));
		i++;
	}
	printf("%s\n",a);
	i=0;
	for (j=0;j<strlen(a);j++)
	{
		a[j]=zh(a[j]-(b[i%7]-'0'));
		i++;
	}
	printf("%s\n",a);
}

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