27 lines
420 B
C
27 lines
420 B
C
/*-------------------------------------------------------
|
||
请编写输出以下图案的程序。(注意:需要使用math库abs)
|
||
1
|
||
123
|
||
12345
|
||
1234567
|
||
12345
|
||
123
|
||
1
|
||
-------------------------------------------------------*/
|
||
#include <stdio.h>
|
||
#include <math.h>
|
||
main()
|
||
{
|
||
int i,j;
|
||
for(i=-3;i<=3;i++)
|
||
{
|
||
/**********Program**********/
|
||
for(j=0;j<7-abs(i)*2;j++){
|
||
printf("%d", j+1);
|
||
}
|
||
printf("\n");
|
||
/********** End **********/
|
||
}
|
||
|
||
}
|