Cpp Dev Programming Forum

Cpp Programming

  • You are not logged in.
  • Polecamy: Gry

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)

esfsf
Today

#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.mistrzowie-magii.pun.pl www.yaoi-of-manhattan.pun.pl www.f1manialiga.pun.pl www.shinigami.pun.pl www.prywatnymetin2.pun.pl