← Back to List

26560번: Periods ↗

Solutions

Python 3
146 B | 146 chars
for i in range(int(input())):
    s = input()
    n = len(s) - 1
    
    while s[n] == '.' and n >= 0:
        n -= 1
    
    print(s[:n+1]+".")