Alright, I got it.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main() {
system("color a");
system("cls");
int height, spaces;
int i, j, k;
printf("Bitte die Hoehe des Dreiecks eingeben: ");
scanf("%d", &height);
spaces = height - 1;
if (height < 1) {
printf("Ungueltige Eingabe!\n");
}
for (i = 1; i <= height; ++i) {
for (j = 0; j < spaces; ++j) {
printf(" ");
}
for (k = 0; k < (2 * i - 1); ++k) {
printf("*");
}
spaces--;
printf("\n");
}
getch();
return 0;
}
Thank you for your help.