Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define FOR(i, x, a) for(long i=x; i<=a; i++)
- #define FORD(i, x, a) for(long i=x; i>=a; i--)
- #define ll long long
- #define pii pair < int, int >
- #define vii vector < pii >
- #define ms(a, x) memset(a, x, sizeof(a))
- #define NMAX 1001
- using namespace std;
- int t;
- string s;
- int main() {
- ios_base::sync_with_stdio(false); cin.tie(NULL);
- //freopen("text.inp", "r", stdin);
- cin >> t;
- getline(cin, s);
- long i;
- char u;
- while (t--) {
- getline(cin, s);
- string x = "";
- i = 1;
- while (i < s.size() && s[i] != ' ') x += s[i], i++;
- if (x.size()) {
- cout << char(x[0] - 32);
- FOR(j, 1, x.size() - 1) cout << x[j];
- cout << char(s[0] + 32);
- }
- else cout << s[0];
- cout << "ay ";
- i++;
- while (i < s.size()) {
- u = s[i];
- i++;
- if (i == s.size()) {
- cout << u << "ay ";
- break;
- }
- while (i < s.size() && s[i] != ' ') cout << s[i], i++;
- cout << u << "ay ";
- i++;
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement