您的位置:首页 > 其它

【HUSTOJ】1070: 拐角III

2016-05-06 12:38 323 查看


1070: 拐角III

Time Limit: 1 Sec  Memory Limit: 128 MB

Submit: 41  Solved: 35

原题链接


Description

输入整数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");
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: