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;
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