A - Keyboard Editorial by evima


You can use if statements like if(S[0] == 'Y' && T[0] == 'a') printf("A\n"); for all possible 6 cases, or you can perform common operation for each \(S\) using the property that you can switch lowercase/uppercase by xor-ing by \(32\).

Sample code in C++

#include<stdio.h>
char S[3];
char T[3];
int main(){
	scanf("%s%s",S,T);
	if(S[0]=='Y'){
		T[0]^=32;

	}
	printf("%s\n",T);
}

posted:
last update: