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++对C的优越性!!!

Posted by sicojuy at 2010-12-02 12:25:52 on Problem 3749
#include <iostream>
#include <string>
using namespace std;

int main()
{
    string str;
    int i, n;
    while(getline(cin, str), str != "ENDOFINPUT")
    {
        getline(cin, str);
        n = str.length();
        for(i = 0; i < n; ++i)
        {
            if(str[i] >= 'A' && str[i] <= 'Z')
            {
                str[i] -= 5;
                if(str[i] < 'A')
                    str[i] += 26;
            }
        }
        cout << str << endl;
        getline(cin, str);
    }
    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