题目描述

Here is a rather simple class definition:

class Person {
private:
string lname; // Person’s last name
string fname; // Person’s first name
public:
Person(); // Constructor to initialize lname and fname
// the following methods display lname and fname
void Show() const; // firstname lastname format
void FormalShow() const; // lastname, firstname format
};

Write a program that completes the implementation by providing code for the undefined methods. The program in which you use the class should also use the constructor calls (two arguments) and the two display methods.


输入格式

The input consists of n (0<n<100) lines.
Each line consists of Char_A('y'), String_B(last name), String_C(first name).
The last line of input consists of Char_D('n').


输出格式

Output two lines for each person.
line 1: firstname lastname format
line 2: lastname firstname format


样例数据

输入

y Holmes Sherlock
y Han Meimei
n

输出

Sherlock Holmes
Holmes Sherlock
Meimei Han
Han Meimei

备注


操作

评测记录

优秀代码

信息

时间限制: 1s
内存限制: 128MB
评测模式: Normal

题解