Created
February 5, 2013 09:30
-
-
Save suminb/4713319 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
| if __name__ == '__main__': | |
| i, s = 1, 0 | |
| while True: | |
| s += i if i & 1 != 0 else -i | |
| i += 1 | |
| r = i % 1000000 | |
| if r == 0 or r == 1: | |
| print s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment