//someinput.cpp //Illustrate standard input #include using namespace std; int main() { int m,n; char junk; char comma; //designed to hold comma, but could hold //p or x or the symbol 6 ... cout << "Enter integer: "; cin >> m; cout << m << " is an integer." << endl; cout << "Please enter an integer, a comma," << "any character, and an integer."; cin >> m >> comma >> junk >>n; cout << "You entered: \n\tm=" << m << "\tcomma=" << comma << "\tn=" << n << endl; // \n means newline character // \t means tab character cout << "I never used the value in junk, though " << "I read something into it." << endl; char c; //declarations don't have //to be at the beginning cout << "Enter four symbols: "; cin >> junk >> junk >> junk >> c; cout << "The fourth symbol was " << c << endl; float pi; pi=3.14159f; //the f makes this a float constant float f; cout << "Enter a float. "; cin >> f; cout << "pi is: " << pi; cout << " f is : " << f << endl; cout << "Enter 123x567 2.54" << endl; cin >> m >> c >> n >> f; cout << "m=" << m << "\tn=" << n << "\tf=" << f << endl; cout << "Enter 1234.5678" << endl; cin >> m >> f; cout << "m=" << m << "\tf=" << f << endl; return 0; }