/*
* Copyright and version Declaration of the program:
* Copyright (c) 2012, computer College, Yantai University
* All rights reserved.
* File name: Design and output a diamond image. cpp
* Author: Mao Tong
* Completion date: January 1, October 30, 2012
* Version No.: v1.0
* Description of tasks and solutions: use of two-dimensional arrays
* Input Description: None
* Problem description:
* Program output: ""
* Problem Analysis: omitted
* Algorithm Design: omitted
*/
[Cpp]
/*
P_142 case 5.9 design and output a diamond Image
*/
# Include <iostream>
Using namespace std;
Int main ()
{
Char diamond [] [5] = {{'','','*'},{'','*','','*'}, {'*','','','','*'},{'','*','','*',''}, {'','','*','',''}};
Int I, j;
For (I = 0; I <5; I ++)
{
For (j = 0; j <5; j ++)
Cout <diamond [I] [j];
Cout <endl;
}
}
/*
Running result:
Experience: omitted
Knowledge Point Summary: omitted
*/