公式

A - Keyboard 解説 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);
}

投稿日時:
最終更新: