题解 | #直角三角形图案#
直角三角形图案
https://www.nowcoder.com/practice/00dd93f7c7074754b7511bf56d1f15ac
#include <stdio.h> int print(int n) { static int k = 1; for (int i = 0; i < k; i++) { printf("* "); } printf("\n"); k++; if (k != n + 1) { return print(n); } else { k = 1; return 0; } } int main() { int n; while (scanf("%d", &n) != EOF) { int c = print(n); } return 0; }