3
This C code reads integers until Control-Z is typed (end of windows entry).
void main(int argc, char *argv[]) {
char line[100];
int sum = 0;
while(scanf("%s", line) == 1) {
sum += atoi(line);
}
printf("%d\n", sum);
}
How I do the same using the Scanner
in Java ?
Welcome to Stack Overflow in English. Your question is about how to simulate the Java scanf with the input up to CTRL+Z or you just want to know how to input data in Java?
– utluiz