回复 26楼 浅水无殇
给你简单翻译下
#include <stdio.h> void foo(int n) { for(int r = 0;r < n;++r) { for(int c = 0;c < n - r;++c) { printf( "%d", 1+(c+r)*(c+3+r)/2-r); if (r == n-1) printf("");//什么都不打印的意思 else if (c != n-r-1) printf(" "); else printf("\n"); } } } int main() { foo(5); return 0; }

[fly]存在即是合理[/fly]