#include <stdio.h> int main() { int n = 0; while (scanf("%d", &n) != EOF) { int i = 0; for (i = 1; i <= n; i++)//行 { int j = 0; for (j = n - i; j >= 1; j--)//空格数 { printf(" "); } printf("*\n");//换行 } } return 0; }
#include <stdio.h> int main() { int n = 0; while (scanf("%d", &n) != EOF) { int i = 0; for (i = 1; i <= n; i++)//行 { int j = 0; for (j = n - i; j >= 1; j--)//空格数 { printf(" "); } printf("*\n");//换行 } } return 0; }