Generally we need to type the input after running any file where we have std::cin, like the c++ code in below
int M,N;
cin>>M>>N;
int i,a[M],b[N];
for(i=0;i<M;i++)
{
cin>>a[i];
}
for(i=0;i<N;i++)
{
cin>>b[i];
}
Solution ob;
cout<<ob.countPairs(a, b, M, N)<<endl;
I just don't like to enter the same big input every time. So I want to automate this process for the same input, say I save my input in a file called input.txt and after running the file, it should take the input from input.txt and output the results. Ofc saving input to the clipboard is one way but I might want to copy other things while coding and copy-pasting is itself is again one small job.
I use VS code editor in ubuntu and run code in terminal using coderunner extension.