Skip to content

Instantly share code, notes, and snippets.

@longyue0521
Last active May 16, 2018 10:50
Show Gist options
  • Select an option

  • Save longyue0521/02c8b60691bfeec163941f883918019e to your computer and use it in GitHub Desktop.

Select an option

Save longyue0521/02c8b60691bfeec163941f883918019e to your computer and use it in GitHub Desktop.
Fast Read int From Stdin In C
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