mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
ed2de2e423
1500-1599
27 lines
626 B
C++
27 lines
626 B
C++
#include <iostream>
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <cstring>
|
|
using namespace std;
|
|
int main()
|
|
{
|
|
string lib;
|
|
cin >> lib;
|
|
for(char c = 'Z'; c >= 'A'; --c)
|
|
{if(lib.find(c) == string::npos){lib += c;}}
|
|
string line;
|
|
cin.ignore(1);
|
|
while(getline(cin , line))
|
|
{
|
|
for(size_ i = 0; i < line.size(); ++i)
|
|
{
|
|
if(isupper(line[i]))
|
|
{line[i] = 'A' + lib.find(line[i]);}
|
|
else if(islower((line[i])))
|
|
{line[i] = 'a' + lib.find(toupper(line[i]));}
|
|
}
|
|
cout << line << endl;
|
|
}
|
|
return 0;
|
|
}
|