Taking Input in MIXTURES

why we need to take input till the end of file in this ques . We also dont do this in other ques which do not possess test cases
https://ide.codingblocks.com/s/35269
ques link https://www.spoj.com/problems/MIXTURES/

your code is giving runtime error due to infinite recursion.

It’s not a problem,

    while(cin >> n) {
            input the array
            do_the_operations
            print_ans
    }
1 Like

i have corrected the code but why we dont do this in other problems which also not have any testcase

its because other problems are giving input in different ways.
this problem wants us to take input till end of line is countered.

1 Like

**end of file (not line)