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 HBU_try at 2005-09-14 13:09:23 on Problem 2141
#include "iostream.h"
#include "string.h"
#include "stdio.h"

int main(int argc, char* argv[])
{
	char a[27]={"abcdefghijklmnopqrstuvwxyz"},b[27],c[81];
	char e[27]={"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
	int i,len,j;

	while(gets(b))
	{	
	
		gets(c);
		len=strlen(c);
		for(j=0;j<27;j++)
		{
			if(c[0]==e[j]) 
			{
				printf("%c",b[j]-32);
			}
		}
		for(i=1;i<len;i++)
		{
			for(j=0;j<27;j++)
			{
				if(a[j]==c[i]) 
				{
				
					printf("%c",b[j]);
					break;
				}
				else if(c[i]==' ') 
				{
					printf("%c",c[i]);
					break;
				}
			}
		}
		printf("\n");
	}
	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