My Visual Studio tells me to use `scanf_s()`, and now that I've used it, my `while` loop goes on forever. Let's say I'm reading lines, where each line has two numbers separated with a space. Once I've inserted all the numbers, my `while` never stops. How do I quit my loop?

```cpp
int main() {

    int i,j;
    while (scanf_s("%d %d", &i, &j)) {
        int maxLength = 0;
        for (int index = i; index <= j; index++) {
            int tmp = cycle(index);
            if (tmp > maxLength) {
                maxLength = tmp;
            }
        }
        printf("%d %d %d\n", i, j, maxLength);
    }

    cout << "lol";
    return 0;
}

```