-
Notifications
You must be signed in to change notification settings - Fork 0
/
cript.cpp
47 lines (37 loc) · 953 Bytes
/
cript.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <iostream>
#include <string>
#include <stdio.h>
#define br "\n";
#define LLI long long int
#define fr(i, b, c) for (int i = b; i < c; i++)
using namespace std;
int main()
{
string data;
int cases;
scanf("%d", &cases);
cin.ignore();
fr(i, 0, cases)
{
getline(cin, data);
fr(i, 0, data.size())
{
if ((data.at(i) >= 65 && data.at(i) <= 90) || (data.at(i) >= 97 && data.at(i) <= 122))
{
char temp = data.at(i);
int tempAscii = int(temp);
tempAscii += 3;
data.at(i) = char(tempAscii);
}
}
data = string(data.rbegin(), data.rend());
fr(i, (data.size() / 2), data.size())
{
char temp = data.at(i);
int tempAscii = int(temp);
tempAscii--;
data.at(i) = char(tempAscii);
}
cout << data << br;
}
}