Generally we need to type the input after running any file where we have std::cin
, like the C++ code in below
#include <iostream>
using namespace std;
int main()
{
// your code goes here
int t;
cin >> t;
}
I just don't like to enter the same 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. Of course 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 windows and run code in terminal extension.