Lab 2. C++ cout, endl, cin 예


Lab 2. C++ cout, endl, cin 예

#include <iostream> #include <string> using namespace std; int main () { //declarations string name; int age; float bodyTemp; //input cout <<"Enter your name" << endl; cin >> name; cout << "Hello " << name << "! " << endl; cout <<"Enter your age." << endl; cin >> age; cout <<"Wow " << name <<"," << age <<" is really old!" << endl; cout <<"Enter your body temperature to the tenth decimal place please." << endl; cin >> bodyTemp; cout <<"That's nothing! My CPU runs hotter than " << bodyTemp << " al...



원문링크 : Lab 2. C++ cout, endl, cin 예