Skip to content

Instantly share code, notes, and snippets.

@kasramp
Last active April 18, 2016 23:17
Show Gist options
  • Save kasramp/4132efed97215b601415da1550e9caa6 to your computer and use it in GitHub Desktop.
Save kasramp/4132efed97215b601415da1550e9caa6 to your computer and use it in GitHub Desktop.
Star
#include<iostream>
using namespace std;
int main (int args, char *argv[]) {
for (int i = 0; i < 5; i++) {
for (int j = i; j < 5; j++) {
cout << "*";
}
for (int j = 0; j <= ((i + 1) * 2); j++) {
cout << " ";
}
for (int j = i; j < 5; j++) {
cout << "*";
}
cout << endl;
}
for (int i = 0; i < 5; i++) {
for (int j = 0; j <= i; j++) {
cout << "*";
}
for (int j = 11; j > (i * 2); j--) {
cout << " ";
}
for (int j = 0; j <= i; j++) {
cout << "*";
}
cout << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment