4.4

#define  _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
using namespace std;
int main()
{
	string first_name;
	string last_name;


	cout << "Enter your first name : ";
	getline(cin,first_name);
	cout << "Enter your last name : ";
	getline(cin, last_name);
	cout << "Here's the information in a single string: " << last_name << ',' << first_name <<endl;
	return 0;
}

你可能感兴趣的:(C++)