C++
hi how do i write i script in C++ that takes in a persons " NAME SURNAME & INITIALS" in one line.
then after that i echo out the the " NAME SURNAME $ INITIALS" in this order "SURNAME INITAILS $ NAME".
i tried doing this but did not execute what i want.#include <iostream>
# include <string>
using namespace std;
int main()
{
string names1, names2, names3;
cout << " PLease enter set of 3 names";
getline(cin, names2);
clear;
cout << names1 << endl;
cout << names2 << endl;
cout << names3 << endl;
return 0;
}
|