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

帮我看一下我的程序呀,到底哪里错了。我都提交了n次了,为什么总是WrongAnswer 呀,非常感谢!!!

Posted by 00448228 at 2005-04-08 18:42:08 on Problem 2141
#include <iostream.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>

char input2[26];
char output[81];
char temp[81];
char large;
void main()
{
	int i;
	for(i=0;i<26;i++)
	{
		cin>>input2[i];
	}
	gets(temp);
	for(i=0;i<81;i++)
	{
		
		switch(temp[i])
		{
			case'a':
			case'A':output[i]=input2[0];break; 
			case'b':
			case'B':output[i]=input2[1];break;
			case'c':
			case'C':output[i]=input2[2];break;
			case'd':
			case'D':output[i]=input2[3];break;
			case'e':
			case'E':output[i]=input2[4];break;
			case'f':
			case'F':output[i]=input2[5];break;
			case'g':
			case'G':output[i]=input2[6];break;
			case'h':
			case'H':output[i]=input2[7];break;
			case'i':
			case'I':output[i]=input2[8];break;
			case'j':
			case'J':output[i]=input2[9];break;
			case'k':
			case'K':output[i]=input2[10];break;
			case'l':
			case'L':output[i]=input2[11];break;
			case'm':
			case'M':output[i]=input2[12];break;
			case'n':
			case'N':output[i]=input2[13];break;
			case'o':
			case'O':output[i]=input2[14];break;
			case'p':
			case'P':output[i]=input2[15];break;
			case'q':
			case'Q':output[i]=input2[16];break;
			case'r':
			case'R':output[i]=input2[17];break;
			case's':
			case'S':output[i]=input2[18];break;
			case't':
			case'T':output[i]=input2[19];break;
			case'u':
			case'U':output[i]=input2[20];break;
			case'v':
			case'V':output[i]=input2[21];break;
			case'w':
			case'W':output[i]=input2[22];break;
			case'x':
			case'X':output[i]=input2[23];break;
			case'y':
			case'Y':output[i]=input2[24];break;
			case'z':
			case'Z':output[i]=input2[25];break;
			case'\t': cout<<" ";break;
			default: break;
		}
	}
	char large=toupper(output[0]);
	cout<<large;
	for(i=1;i<81;i++)
	{
		cout<<output[i];
	}
}



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