Overview Version History Q & A Rating & Review
VSCode Input
STDIN Input for C++ and Python programs through comment
VSCode Input is a extension for VScode which executes the program of the current open file and feeds as STDIN input the values provided in input comment.
The input is obtained through the comments written on top of the file like the examples shown in Usage
Inspirated by Sublime Input
It is possible to change path to executable and execution flags via Preferences: Open Settings .
Name
Description
vscode-input.compile-command.cpp
Specifies the compile command to run C++. You can add or remove flags if it's necessary, such as -std=c++-17.
vscode-input.run-command.py
Specifies the command to execute program
Usage
C++
/*input
3
string_1
string_2
string_3
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
string s;
cin >> t
while (t--) {
cin >> s;
cout << s << endl;
}
return 0;
}
Python 3
"""input
3
string_1
string_2
string_3
"""
t = int(input())
while True:
if t <= 0:
break
print(input())
t -= 1
Output
string_1
string_2
string_3
Keyboard Shortcuts
Ctrl + Alt + b - vscode-input.Build - Builds and runs the program (⌘⇧B for Mac)
Ctrl + Alt + c - vscode-input.Cancel - Cancels current running program (⌘⇧C for Mac)