Design and output a diamond Image

Source: Internet
Author: User

/*
* 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
*/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.