討論串[問題] 打星號畫圖
共 12 篇文章

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者tkcn (小安)時間16年前 (2009/11/04 19:45), 編輯資訊
0
0
0
內容預覽:
糟糕..好方法大家都寫完了. 這時候才秀這種好像有點虛...Orz. char str[100];. memset(str, '*', 100);. for(int p=-1,i=0;i<3;i++). str[p+=i+2] = '\n';. str[p+1] = 0;. printf(str);

推噓1(1推 0噓 4→)留言5則,0人參與, 最新作者adrianshum (Alien)時間16年前 (2009/11/04 15:12), 編輯資訊
0
0
0
內容預覽:
void printStar(int num) {. if (num > 0) {. printf("*");. printStar(num - 1);. }. }. void printStarLine(int size, boolean increment) {. if (level > 0)
(還有328個字)

推噓7(7推 0噓 1→)留言8則,0人參與, 最新作者ccpz (OoOoOo)時間16年前 (2009/11/04 13:43), 編輯資訊
0
0
0
內容預覽:
#include <stdio.h>. int main(). {. int i=0;. for(i=1;i<=10;i++). printf("%.*s\n", i, "****************");. return 0;. }. --. #1Ade1pyY (Baseball). --.

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者OpenBigJue (開大決)時間16年前 (2009/11/04 13:29), 編輯資訊
0
0
0
內容預覽:
這要考的應該是一維陣列表示二維圖形的方法 @Q@. const int num = 3;. for(int i=0; i<num*num; ++i). {. if( i/num >= i%num ). printf("*");. else. printf(" ");. if( i%num == nu
(還有222個字)

推噓4(4推 0噓 1→)留言5則,0人參與, 最新作者adrianshum (Alien)時間16年前 (2009/11/04 11:31), 編輯資訊
0
0
0
內容預覽:
你當是 psuedo code 看好了 :P. char * LONG_STAR_STRING = new char[n+1];. memset(LONG_STAR_STRING, '*');. LONG_STAR_STRING[n] = '\0';. for (i = 0; i < n; i++)
(還有154個字)