如何在 SublimeText 2.0.1 中使用控制台输入?我选择了“工具 -> 构建系统 -> C++”,并将 hello.cpp 文件添加到项目中:
#include <iostream>
int main()
{
int a, b, c;
std::cout << "Enter: ";
std::cin >> a >> b;
c = a + b;
std::cout << a << '+' << b << '=' << c << std::endl;
return 0;
}
构建成功,但是当我运行(“工具->运行”)时,“std::cin >> a >> b;”行 已通过,我无法输入值。在带有 g++ 的终端中,它运行良好。操作系统:Ubuntu 12.04