When i try to run my cpp code with multiple testcases on ubuntu then i get unexpected results. It works fine when i run testcases one by one but when i copy and paste testcases then terminal gives unexpected line breaks
For example
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
cout<<n<<"Hello"<<endl;
}
}
when i run this code with testcase 5 4 3 2 1 5
by directly copying and pasting i get following result
5
4
3
2
1
5 4Hello
3Hello
2Hello
1Hello
5Hello
instead of
5
4
3
2
1
5
4Hello
3Hello
2Hello
1Hello
5Hello
can anyone tell whats the problem i have tried for many hours researching but i am not getting any solution. I have tried konsole,xterm,gnome terminal all are giving same results on directly doing copy paste of testcases.