Cpp Dev Programming Forum

Cpp Programming


#1 Today

es

Guest

diamond

#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.tibiacc.pun.pl www.niewielkiazyl.pun.pl www.mobileinfantry.pun.pl www.lksorzelwysoka.pun.pl www.sonyericsson4ever.pun.pl