题解 | #数字三角形#
数字三角形
https://www.nowcoder.com/practice/804a22929b844e6b9379a5e90b5e2197
#include <stdio.h>
int main() {
int a;
while (scanf("%d", &a) != EOF) { // 注意 while 处理多个 case
// 64 位输出请用 printf("%lld") to
for(int j = 1;j <=a;j++)
{
for(int i = 1;i <= a;i++)
{
if(j >= i)
{
printf("%d ",i);
}
}
printf("\n");
}
}
return 0;
}
查看11道真题和解析