c++基础(2)

来源:互联网 发布:centos怎么修改语言 编辑:程序博客网 时间:2024/06/05 15:49
#include <iostream>#include <string>using namespace std;int main(){  string mystr;  cout << "What's your name? ";  getline(cin, mystr);  cout << "Hello " << mystr << ".\n";  cout << "What is your favorite team? ";  getline(cin, mystr);  cout << "I like " << mystr << " too!\n";  return 0;}
原创粉丝点击