Cpp Dev Programming Forum

Cpp Programming


Post a reply

Write your message and submit
Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

es
Today

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{

int a;
cout << "Podaj bok: " ;
cin >> a;


for (int i=1; i<=a-1; i++){
cout << endl;
     for (int j=0; j<=2*a; j++){
if ((j<=2*a-i) && (j>=i)) cout << "*";
else cout << " ";

}
}

for (int i=0; i<=a-1; i++){
cout << endl;
     for (int j=0; j<=2*a; j++){
if ((j>=a-i) && (j<=a+i)) cout << "*";
else cout << " ";
}
}

cout << endl << endl;

system("pause");
return 0;
}

Board footer

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.wild-west.pun.pl www.pokemonunovahistory.pun.pl www.frag-cs.pun.pl www.bakuganmlodziwojownicy.pun.pl www.is3.pun.pl