christmastree

mail@pastecode.io avatar
unknown
c_cpp
2 years ago
539 B
1
Indexable
Never
#include <stdio.h>
#include <stdlib.h>

void zad8(){

    int n;
    int l=0;
    printf("Jaka duza choinka? ");
    scanf(" %i", &n);
    for (int i=1; i<=n; i++){
        for (int j=1; j<=i+1; j++){
            l = n - j + 1;
            while (l>0) {
                printf(" ");
                l--;
            }

            while (l<(2*j - 1)){
                printf("*");
                l++;
            }
            printf("\n");
        }
    }
}




int main()
{
    zad8();
    return 0;
}