问题
In Visual studio code , i dont want to give long input to my program everytime. Is there a way like in hackerearth to copy paste my input and the program will run on them.
Take this as example.What should i write in args of launch.json. I am new to vscode.Here is my program
回答1:
You have to change the main() as below:
int main(int argc, char* argv[])
{
for(int i = 1; i <argc; ++i)
std::cout<<argv[i];
return 0;
}
This is simple program.
You have to right-click the project, choose Properties, go to the Debugging section -- there is a box for "Command Arguments". Specify the as "34 45 44".
You can run this again and again by mentioning it once.
来源:https://stackoverflow.com/questions/60702210/how-to-put-custom-input-for-debugging-in-visual-studio-code