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

我还真没看出来有什么优越性,付c代码

Posted by Belldandy at 2011-08-20 14:54:27 on Problem 3749
In Reply To:这道题充分显示了C++对C的优越性!!! Posted by:sicojuy at 2010-12-02 12:25:52
#include<stdio.h>
#include<string.h>
int main()
{
	char temp[200]={0},temp1[50]={0},temp2[50]={0};
	char den[30]={"VWXYZABCDEFGHIJKLMNOPQRSTU"};
	int i=0;
	gets(temp1);
	while(strcmp(temp1,"ENDOFINPUT"))
	{
		gets(temp);
		gets(temp2);
		for(i=0;temp[i]!='\0';i++)
		{
			if(temp[i]>='A'&&temp[i]<='Z')
			{
				printf("%c",den[temp[i]-'A']);
			}
			else
			{
				printf("%c",temp[i]);
			}
		}
		printf("\n");
		gets(temp1);
	}
        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