题目描述

Write a program that displays the checkerboard pattern according to the inputs. Your program must use only three output statements, one of each of the following forms:

cout << "* ";
cout << ' ';
cout << endl;

输入格式

Input contains serveral lines.
Each line contains a number that indicate the number of row and column you should display.
Exit the program when input integer is -1.


输出格式

Display the checkboard pattern that consist of # rows and # column.
# is the number from input.


样例数据

输入

3
8
-1

输出

 * * * 
* * * 
 * * * 

* * * * * * * * 
 * * * * * * * * 
* * * * * * * * 
 * * * * * * * * 
* * * * * * * * 
 * * * * * * * * 
* * * * * * * * 
 * * * * * * * * 

备注

Note that the first lines of checkboard are different, according to the odd/even of the input number


操作

评测记录

优秀代码

信息

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

题解