2025-03-06 22:46:33 +08:00

27 lines
420 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*-------------------------------------------------------
请编写输出以下图案的程序。(注意需要使用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 **********/
}
}