MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / nextInt

Method nextInt

src/class154/FollowUp1.java:177–193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175 }
176
177 int nextInt() throws IOException {
178 int c;
179 do {
180 c = readByte();
181 } while (c <= ' ' && c != -1);
182 boolean neg = false;
183 if (c == '-') {
184 neg = true;
185 c = readByte();
186 }
187 int val = 0;
188 while (c > ' ' && c != -1) {
189 val = val * 10 + (c - '0');
190 c = readByte();
191 }
192 return neg ? -val : val;
193 }
194 }
195
196}

Callers 1

mainMethod · 0.95

Calls 1

readByteMethod · 0.95

Tested by

no test coverage detected