Skip to content

Instantly share code, notes, and snippets.

@unaipme
Created October 5, 2017 05:40
Show Gist options
  • Save unaipme/1a6150410c6db31cf852628de51f5d1c to your computer and use it in GitHub Desktop.
Save unaipme/1a6150410c6db31cf852628de51f5d1c to your computer and use it in GitHub Desktop.
N gehienezko lodiera duen gezia (edo piramidea) inprimatzen duen kodea
#include<stdio.h>
int main() {
int n, x, y;
printf("Sartu zenbakia: ");
scanf("%d", &n);
for (y=0; y<n * 2; y++) {
int topea;
if (y <= n) {
topea = y;
} else {
//topea = n - (y - n);
topea = 2 * n - y;
}
for (x=0; x<topea; x++) {
printf("* ");
}
printf("\n");
}
printf("Sakatu intro ateratzeko...");
getchar();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment