
Untitled
By: a guest on
Aug 10th, 2012 | syntax:
None | size: 0.63 KB | hits: 25 | expires: Never
Sublime Text with console input for c programs
#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;
}
#include <iostream>
#include <fstream>
#define SUBLIME
#if defined SUBLIME
# define ISTREAM ifile
#else
# define ISTREAM std::cin
#endif
int main()
{
int a, b, 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;
}