MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / readn

Function readn

code/tricks/fast_input.cpp:1–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1void readn(register int *n) {
2 int sign = 1;
3 register char c;
4 *n = 0;
5 while((c = getc_unlocked(stdin)) != '\n') {
6 switch(c) {
7 case '-': sign = -1; break;
8 case ' ': goto hell;
9 case '\n': goto hell;
10 default: *n *= 10; *n += c - '0'; break; } }
11hell:
12 *n *= sign; }
13// vim: cc=60 ts=2 sts=2 sw=2:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected