View Single Post
Old 03-05-2005, 03:18 PM   #38
Unknown Hero
Home Sweet Abandonia

 
Join Date: Aug 2004
Location: Split, Croatia
Posts: 1,028
Default

Quote:
Originally posted by NrmMyth@Mar 5 2005, 06:05 PM
Take a look at this easy exam.
The input is the height of the piramide you have to print it.

Code:
height=4

 * **
 * * *
 ** * *
* * * *
You got the point.
Solved!!!


Code:
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
 * *int n,i,j;
 * *cin >> n;
 * * * for (i=n-1; i>=0; i--)
 * * * {
 * * * * * j=0;
 * * * * * while (j<i)
 * * * * * {
 * * * * * * * cout << " ";
 * * * * * * * j++;
 * * * * * }
 * * * * * while (j<n)
 * * * * * {
 * * * * * * * * cout << "*";
 * * * * * * * * cout << " ";
 * * * * * * * * j++;
 * * * * * }
 * * * * * cout << endl; * * * * * * * * 
 * * * }
 * *return 0;
}
Unknown Hero is offline                         Send a private message to Unknown Hero
Reply With Quote