0

How do I take the input in this case?

I need to take input a pair of integer for each test case,but the test case number isn't given.i.e SAMPLE INPUT: 1 2 3 4... I could use cin in a for loop but how do I know when to terminate the loop? It would be better to show the solution in C++

11th May 2020, 8:39 AM
Dipra Irham
Dipra Irham - avatar
2 Answers
+ 2
U can simply use cin>>int1>>int2;
11th May 2020, 8:48 AM
Shreyansh
Shreyansh - avatar
+ 1
I think you want something like this: while(cin>>i1>>i2){}
11th May 2020, 9:10 AM
Chelovek Chelovekov