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 ccnu_ltg at 2009-03-20 22:29:06 on Problem 2141
#include <iostream>
using namespace std;

int main()
{
	char a[100];
	char b[81];
	 memset(b,'0',81);
	int i,n,j;
     cin>>a;
	fflush(stdin);
	while(gets(b))//此处去掉循环还是会wa
	{
	//gets(b);
     n=strlen(b);
	for (i=0;i<n;i++)
	{
		if (b[i]!='\n')
		{
     if (b[i]>='a'&&b[i]<='z')
	 {
		 j=b[i]-'a';
		 b[i]=a[j];
		 cout<<b[i];
	 }
	 else
	 {
		 if (b[i]>='A'&&b[i]<='Z')
		 {
            j=b[i]-'A';
			b[i]=a[j]-32;
			cout<<b[i];
		 }
		 else
			 cout<<b[i];
	 }
		}
		 
	}
	 //cout<<endl;
	}
	 
   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