Skip to content

Instantly share code, notes, and snippets.

@tudorconstantin
Created February 2, 2015 17:46
Show Gist options
  • Select an option

  • Save tudorconstantin/d8079734de75bd8e07eb to your computer and use it in GitHub Desktop.

Select an option

Save tudorconstantin/d8079734de75bd8e07eb to your computer and use it in GitHub Desktop.
cs50 mario pyramid
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int y;
int x;
int space;
int hash;
do {
printf("alege un nr intre 0 si 23n");
y = GetInt();
} while ((y < 0) || (y > 23));
for (x = 1; x < y; x++) {
for ((space = y - x); space > 0; space--) {
printf(" ");
}
for(hash = 1; hash <=(x + 1); hash++){
printf("#");
}
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment