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