Created
March 15, 2018 08:14
-
-
Save NeedPainkiller/75a5bd2ed4c3506b73805aec3133a4a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def checkTrait(c): | |
| return (int((ord(c) - 0xAC00) % 28) != 0) | |
| def openInput(): | |
| inputs = open('./input.txt', 'r', encoding='UTF8') | |
| res = '' | |
| for line in inputs: | |
| for index, s in enumerate(line): | |
| if(s == "을" and checkTrait(line[index-1]) == False): | |
| line = line[:index] + '를' + line[index+1:] | |
| if(s == "를" and checkTrait(line[index-1]) == True): | |
| line = line[:index] + '을' + line[index+1:] | |
| res += line | |
| inputs.close() | |
| outputs = open('./output.txt', 'w', encoding='UTF8') | |
| outputs.write(res) | |
| outputs.close() | |
| openInput() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment