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

好吧好吧,连大写都没看到!囧~~~

Posted by 1004101213 at 2012-05-16 21:54:19 on Problem 2141
还以为全变成小写呢!唉……

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<stdlib.h>
#include<algorithm>
using namespace std;
char s[30];
char a[150];
int main()
{
    int i,b;
    scanf("%s",s);
    getchar();
    gets(a);
    for(i=0;i<strlen(a);i++)
    {
        if(a[i]!=' ')
        {
            if(a[i]>='A'&&a[i]<='Z')
            {
                b=a[i]-'A';
                a[i]=toupper(s[b]);
            }
            else{
            b=(a[i]-'a');
            a[i]=s[b];
            }
        }
    }
    puts(a);
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