Problem 1
user_1944374
c_cpp
2 years ago
1.0 kB
15
Indexable
#include <bits/stdc++.h> #define F first #define S second #define PB push_back #define MP make_pair #define MOD (int) 1e9 + 7 #define all(x) begin(x), end(x) typedef long long ll; using namespace std; template <typename T> // cin >> vector<T> istream &operator>>(istream &istream, vector<T> &v) { for (auto &it : v) cin >> it; return istream; } template <typename T> // cout << vector<T> ostream &operator<<(ostream &ostream, const vector<T> &c) { for (auto &it : c) cout << it << " "; return ostream; } /* Problem Name: QWERTY Sample Input: 2 cd foolscoding Sample Output: er yggslegrofu */ void solve(void) { string s; cin >> s; string key = "qwertyuiopasdfghjklzxcvbnm"; for(int i = 0; i < s.length(); i++) { cout << key[s[i] - 'a']; } cout << "\n"; } int main() { ios::sync_with_stdio(0); cin.tie(0); int T; cin >> T; while(T--) { solve(); } return 0; }
Editor is loading...