Cpp Dev Programming Forum

Cpp Programming

  • You are not logged in.
  • Polecamy: Gry

#1 Today

esfsf

Guest

hourglass

#include <cstdlib>
#include <iostream>

using namespace std;

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

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

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

for (int i=2; i<=a; i++){
cout << endl;
     for (int j=0; j<=2*a; j++){
if ((j<=2*a-i) && (j>=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.sonyericsson4ever.pun.pl www.mobileinfantry.pun.pl www.niewielkiazyl.pun.pl www.vsmarbar.pun.pl www.tibiacc.pun.pl