题解 | #空心正方形图案#
空心正方形图案
https://www.nowcoder.com/practice/72347ee949dc47399186ee183632f303
#include <stdio.h>
int main() {
int a;
while(~scanf("%d",&a))
{
int i,j;
for(i=1;i<=a;i++)
{
for(j=1;j<=a;j++)
{
if(i==1||i==a||j==1||j==a)
printf("* ");
else
printf(" ");
}
putchar('\n');
}
}
return 0;
}

海康威视公司福利 1137人发布