1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
string fn1, fn2, fn3, ln1, ln2, ln3, tmpName1, tmpName2, tmpName3, name0, name1, name2, name3;
cout << "Name 1: ";
getline(cin, name1);
cout << "Name 2: ";
getline(cin, name2);
cout << "Name 3: ";
getline(cin, name3);
cout << endl;
if (name3.size() < name1.size())
{
name0=name1;
name1=name3;
name3=name0;
}
if (name2.size() < name1.size())
{
name0=name1;
name1=name2;
name2=name0;
}
if (name3.size() < name2.size())
{
name0=name2;
name2=name3;
name3=name0;
}
cout << name1 << endl;
cout << name2 << endl;
cout << name3 << endl;
return 0;
}
|