1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #include <stdio.h> void main() { int start = 0, end = 10; for(int i = 0; i < 9; i++) { if(i < 10/2) { start = i, end––; } else { start––, end++; } for(int j = start; j > 0; j––) { printf(” “); } for(int j = start; j < end; j++) { printf(“*”); } printf(“\n”); } } | cs |