1070: 拐角III
Time Limit: 1 Sec Memory Limit: 128 MBDescription
输入整数N,输出相应方阵。
Input
一个整数N。( 0 < n < 10 )
Output
一个方阵,每个数字的场宽为3。
Sample Input
5
Sample Output
5 5 5 5 5
5 4 4 4 4
5 4 3 3 3
5 4 3 2 2
5 4 3 2 1
HINT
Source
#include<stdio.h>
main()
{
int N;
scanf("%d",&N);
for(int i=N;i>=1;i--)
{
int count=0;
for(int j=N;count<N;j--)
{
count++;
printf("%3d",j);
if(i==j)j++;
}
printf("\n");
}
}

2704

被折叠的 条评论
为什么被折叠?



