[C++] HHKB Programming Contest 2020 A번 Keyboard

HHKB Programming Contest 2020 A번 Keyboard

문제

https://atcoder.jp/contests/hhkb2020/tasks/hhkb2020_a HHKB2020A

풀이

S에 ‘Y’가 입력되면 T를 대문자로

S에 ‘N’이 입력되면 T를 소문자로 출력

코드

#pragma warning(disable : 4996)
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef tuple<ll,ll,ll> tl3;
#define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
#define FORN(a, b, c) for (int(a) = (b); (a) <= (c); ++(a))
#define rep(i, n) FOR(i, 0, n)
#define repn(i, n) FORN(i, 1, n)
#define tc(t) while (t--)
// https://atcoder.jp/contests/hhkb2020/tasks/hhkb2020_a
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    string s,t;
    cin >> s >> t;
    if(s[0] == 'Y') {
        cout << (char)(t[0]-32);
    }   
    else{
        cout << t;
    }

    return 0;
}