Created
October 5, 2017 05:40
-
-
Save unaipme/1a6150410c6db31cf852628de51f5d1c to your computer and use it in GitHub Desktop.
N gehienezko lodiera duen gezia (edo piramidea) inprimatzen duen kodea
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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