课后习题4.4
#include<stdio.h>
int main(){
??? int height = 0 ;
??? int width = 0 ;
??? int i = 0 ;
??? int j = 0 ;
??? printf("Please input the length and width of the room cosnt by * ! \n ");
??? scanf(" %d %d",&height,&width);
??? for (; i < height ; i++){
??? ??? printf("*");
??? ??? if( i == 0 || i == height - 1){
??? ??? ??? for(j = 0 ; j < width - 2 ; j++){
??? ??? ??? ??? printf("*");
??? ??? ??? }
??? ??? }else{
??? ???
??? ??? for( j = 0; j < width - 2 ; j++){
??? ??? ??? printf(" ") ;
??? ??? ??? }
??? ???
??? ??? }
??? ??? printf("*\n") ;
??? }
??? return 0;
}