How can I enter with cin while running c++ file in vs code?

In the past, I only used dev c++, but due to my personal situation, I had to use tablets as a substitute for a laptop, so I have to use github’s code space. So I’m setting it up to use vs code as a desktop at home. I’ve been looking at several posts on the Internet, and I’ve seen a clean-up post that lets me put the exe file in one folder, so it’s running really well.

int n = 9;

for(int i = 0 ; i < n ; i++){
    cout << i << ' ';
}

return 0;

It seems to be outputting properly to the debug console.

But the problem happens when I try to input variable value through cin.

If I put one “cin >> n;” below “int n = 9;”, I can’t input it in the terminal, and if I input it in the debug console, it says “Unable to perform this action because the process is running.” What should I do?…

I want to solve the algorithm problem of input value in vs code.

  • In the future it’ll work much better if you upload your pictures and photos to Facebook or Twitter, instead. That’s because those web sites are designed for that. Stackoverflow is designed for answerable questions that get asked in plain text, so that everyone can cut/paste it and try it themselves. Can you remove all images and photos from your question, and include the same information as plain text, and verify that your question meets all requirements for a minimal reproducible example, as explained in Stackoverflow’s help center? See How to Ask for more information.

    – 

  • @SamVarshavchik I do not get your idea of uploading images to FB/X. For use here? I do not think that this is best practice. Imgur for anything that really is better as an image is still favorite, isn’t it? If there is sarcasm or joking involved please take this/me as example of it backfiring…. (I do agree with text as choice #1 of course.)

    – 




  • If you would like to upload some images or photos of your cat, or anything else, @Yunnosch, then Facebook or Twitter would be a better place to do that. Is that not clear? That should be self-evident.

    – 




  • I change the post. Thank you. This post is my first question, so I’m not good at this site..

    – 




  • @SamVarshavchik Ah. What a relief. You mean those sites for images which are NOT going to be used here. Yes, I agree.

    – 




Leave a Comment