luhn1 [백준] 14726 1 2 3 4 5 6 7 8 9 10 11 for _ in range(int(input())): s=input() tmp='' for i in range(len(s)): if i%2==0 : tmpnum=2*int(s[i]) if tmpnum>9: tmpnum= tmpnum%10+tmpnum//10 tmp+=str(tmpnum) else: tmp+=s[i] if sum(list(map(int,tmp)))%10==0:print("T") else: print("F") Colored by Color Scripter cs Luhn 알고리즘 을 구현하는 문제라고 보시면 됩니다. 크게 어렵지 않아용~ 2021. 1. 28. 이전 1 다음