作者librayan926 (YAN)
看板TransCSI
标题Re: [问题] 一题小考题目
时间Sun Oct 29 22:22:42 2006
我程式没有很强
不过应该用两层回圈就可以跑出来
int a,b,c;
for(;;)
{
printf("key side of squares (1~20)\n");
scanf("%d",&b);
if(b<=20 && b>=1)
break;
}
for (a=1;a<=b;a++)
{
for (c=1;c<=b;c++)
printf("*");
printf ("\n");
}
getchar();
system("pause");
system("cls");
※ 引述《myemail (频可欣)》之铭言:
: write a program that reads in the side of a square and prints that
: square out of asterisks. Your program should work for squares of
: all sides between 1 and 20. For example, if your program reads a
: side of 4, it should print
: ****
: ****
: ****
: ****
: 这是我小考题目,请各位大大帮我解答一下 谢谢^^
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 219.68.137.62