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

除了输入空格这一点以外难度系数为0,听说还买一送一?溜达看看去

Posted by nan5515522 at 2014-05-26 12:14:16 on Problem 1298
#include<iostream> 
#include<Cstdio>
#include<string>
using namespace std; 

char input1[10], input2[10];
char input[10000];
int main()  
{ 
	char *p, temp;
	int temp1;
	while(1)
	{
		scanf("%s", input1);
		getchar();
		if(input1[3] == 'O')
			break;
		
		p = input;
		while((temp = getchar()) != '\n')
		{
			*p  = temp;
			p ++;
		}
		*p = '\0';
		//cout << input << endl;
		
		scanf("%s", input2);
		
		
		p = input;
		while(*p != '\0')
		{
			temp1 = -1;
			if((*p -'A' >= 0) && (*p -'A' <= 25))
			   temp1 = *p - 'A';
			if((*p -'a' >= 0) && (*p -'a' <= 25))
				temp1 = *p - 'a';
			
			if(temp1 != -1)
			{
				temp1 = (temp1 + 21) % 26;
				*p = 'A' + temp1;
			}
			p++;
		}   
		cout << input << endl;
	}
} 

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