/* Note:Your choice is C IDE */ #include "stdio.h" void main() { int row,col,r,c; printf("请输入行数"); scanf("%d",&row); printf("请输入列数"); scanf("%d",&col); for(r=1;r<=row;r++) { for(c=1;c<=col;c++) { if(r>1&&r<row&&c>1&&c<col) printf(" "); else printf("*"); } printf(" "); } }