#include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { cout<<_T("输入一行---->")<<endl; char str[30]; cin.getline(str, 30); cout << str << endl; cout << "输入第2行---->" << endl; cin.getline(str, 30); cout << str << endl; cout << "输入第3行---->" << endl; cin.getline(str, 30); cout << str << endl; return 0; }
参考
https://www.imooc.com/wenda/detail/528299
调用通讯
var cp = require('child_process'); //spawn var ls = cp.spawn('ConsoleApplication1.exe'/*command*/, [/*'3s.mp4']*//*args*/, {}/*options, [optional]*/); ls.stdout.on('data', function (data) { console.log('stdout: ' + data); ls.stdin.write('1112 4 '); }); ls.stderr.on('data', function (data) { console.log('stderr: ' + data); }); ls.on('exit', function (code) { console.log('child process exited with code ' + code); });