Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- #include <math.h>
- #include <cmath>
- #include <algorithm>
- #include <stack>
- #include <fstream>
- using std ::cin;
- using std ::cout;
- using std ::string;
- int perevod (char cc) {
- if (cc - '0' <= 9) {
- return cc - '0';
- } else {
- return cc - '0' - 39;
- }
- }
- int main() {
- // std::string name = "/home/rasull/CONTESTS/equatation.in";
- // fstream input(name, input.in);
- // std ::ifstream in("/home/rasull/CONTESTS/tree.in");
- // std ::ofstream out("/home/rasull/CONTESTS/tree.out");
- char next;
- int kk = 0, now = 0;
- string ss = "";
- while ((next = cin.get()) != EOF) {
- ss += next;
- if (!((next >= 65 && next <= 90) || (next >= 97 && next <= 122))) {
- if (now > kk) {
- kk = now;
- }
- now = 0;
- } else {
- ++now;
- }
- }
- for (int ii = 0; ii < ss.size(); ++ii) {
- if ((ss[ii] >= 65 && ss[ii] <= 90)) {
- ss[ii] = static_cast<char>((ss[ii] - 65 + kk) % 26 + 65);
- } else if ((ss[ii] >= 97 && ss[ii] <= 122)) {
- ss[ii] = static_cast<char>((ss[ii] - 97 + kk) % 26 + 97);
- }
- }
- cout << ss;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement