728x90
6996번: 애너그램
첫째 줄에 테스트 케이스의 개수(<100)가 주어진다. 각 테스트 케이스는 한 줄로 이루어져 있고, 길이가 100을 넘지 않는 단어가 공백으로 구분되어서 주어진다. 단어는 알파벳 소문자로만 이루어
www.acmicpc.net
n=int(input())
for i in range(n):
a, b = map(str, input().split())
x = sorted(list(a))
y = sorted(list(b))
if x == y:
print("%s & %s are anagrams." % (a, b))
else:
print("%s & %s are NOT anagrams." % (a, b))
728x90