作者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