VC++6.0中关于for循环的问题!!!!求解答
以下是代码:#include<stdio.h>
int main(void)
{
const unsigned int MIN_SIZE=3;
unsigned int width=0;
unsigned int height=0;
printf("enter values for the width and height (minimum of %u):",MIN_SIZE);
scanf_s("%u%u",&width,&height);
if(width < MIN_SIZE)
{
printf("\nwidth value of %u is too small. setting it to %u.",width,MIN_SIZE);
width=MIN_SIZE;
}
if(height < MIN_SIZE)
{
printf("\nwidth value of %u is too small. setting it to %u.",height,MIN_SIZE);
height=MIN_SIZE;
}
for(unsigned int i=0 ; i<width ; ++i)
{
printf("*");
for(unsigned int j=0 ; j<height-2 ; ++j)
printf("\n*");
for(unsigned int i=0 ; i<width-2 ; ++i)
printf(" ");
printf("*");
}
printf("\n");
for(unsigned int i=0 ; i<width ; ++i)
printf("*");
printf("\n");
return 0;
}
报错:
PS: 以上代码在VS2012能通过编译; 代码照书上的做一个箱子看看,可是不行啊!!