Skip to content

Commit cc5ff2d

Browse files
committedSep 16, 2023
Added 1480A - Yet Another String Game.cpp
1 parent 3c0729b commit cc5ff2d

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
 

‎1480A - Yet Another String Game.cpp

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
5+
#define ll long long
6+
#define pb push_back
7+
#define ff first
8+
#define ss second
9+
#define mp make_pair
10+
11+
// Code Written By: Vikash Patel
12+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
13+
14+
void solve(){
15+
string s;
16+
cin >> s;
17+
int n = s.size();
18+
for(int i = 0;i < n; ++i) {
19+
if(i % 2 == 0) {
20+
if(s[i] == 'a')s[i] = 'b';
21+
else s[i] = 'a';
22+
} else {
23+
if(s[i] == 'z') s[i] = 'y';
24+
else s[i] = 'z';
25+
}
26+
}
27+
cout << s << '\n';
28+
}
29+
30+
int main()
31+
{
32+
ios_base::sync_with_stdio(0);
33+
cin.tie(0);
34+
cout.tie(0);
35+
36+
// #ifndef ONLINE_JUDGE
37+
// freopen("input.txt", "r", stdin);
38+
// freopen("/Users/vikash/Desktop/output.txt", "w", stdout);
39+
// #endif
40+
41+
int t;
42+
cin>>t;
43+
while(t--)
44+
{
45+
solve();
46+
}
47+
return 0;
48+
}

0 commit comments

Comments
 (0)
Please sign in to comment.