Last active
May 16, 2018 10:50
-
-
Save longyue0521/02c8b60691bfeec163941f883918019e to your computer and use it in GitHub Desktop.
Fast Read int From Stdin In C
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
| int read_int() { | |
| char c = getchar_unlocked(); | |
| while(c<'0' || c>'9') c = getchar_unlocked(); | |
| int ret = 0; | |
| while(c>='0' && c<='9') { | |
| ret = 10 * ret + c - 48; | |
| c = getchar_unlocked(); | |
| } | |
| return ret; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment