#include<iostream> #include<string> using namespace std; int main() { string hi("What's your name?"), //string hi="What's your name?", name, line(40,'-'); cout << hi << endl; cout <<line << endl; cout << "My name is "; getline(cin,name); cout <<"hey " << name <<"!" <<"Your name has " <<name.length()<<" characters" << endl <<line << endl; return 0; }
|