Re: [問題] 一題小考題目

看板TransCSI作者 (YAN)時間19年前 (2006/10/29 22:21), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/4 (看更多)
我程式沒有很強 不過應該用兩層迴圈就可以跑出來 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
文章代碼(AID): #15HBZkQP (TransCSI)
文章代碼(AID): #15HBZkQP (TransCSI)