
我选择了“工具 – >构建系统 – > 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
#include <iostream>#include <fstream>#define SUBliME#if defined SUBliME# define ISTREAM ifile#else# define ISTREAM std::cin#endifint main() { int a,c; std::cout << "Enter: "; #if defined (SUBliME) std::ifstream ifile("stdin.input"); #endif ISTREAM >> a >> b; c = a + b; std::cout << a << '+' << b << '=' << c << std::endl; return 0;} 总结 以上是内存溢出为你收集整理的Sublime Text,带有c程序的控制台输入全部内容,希望文章能够帮你解决Sublime Text,带有c程序的控制台输入所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)