Re: [問題] C語言用*畫數字圖形
c
o
l
01234/row
*****0
*****1
*****2
*****3
*****4
create map : 5x5
1 2 3 4 5
* ***** ***** * * *****
* * * * * *
* ***** ***** ***** *****
* * * * *
* ***** ***** * *****
6 7 8 9 0
***** ***** ***** ***** *****
* * * * * * * * *
***** * * ***** ***** * *
* * * * * * * *
***** * ***** ***** *****
suppose n is odd
n > 5
i = (n - 5)/2
copy row3 i times and insert between row2 and row3
copy row1 i times and insert between row2 and row1
copy col3 i times and insert between col2 and col3
copy col1 i times and insert between col2 and col1
show result
n = 1
alweys show "*"
n = 3
delete row3
delete row1
delete col3
delete col1
show result
※ 引述《potter1529 (宋代的才女唱元曲)》之銘言:
: 先說,絕對不會比較快
: 反之應該慢得要死
: 只是單純讓我想到久遠以前邏輯設計課的計數器、解碼器...而已
: 好懷念阿( ̄﹏ ̄)
: 題目是這樣嗎?
: 7*7的box 9*9的box
: ******* *********
: * * * *
: * * * *
: ******* *********
: * * * *
: * * * *
: ******* *********
: 那把數字看成電梯格子那樣
: 5
: *******
: * *
: 1 * 7 * 3
: *****
: * *
: 2 * * 4
: *******
: 6
: 存一個陣列 int a[7]={0};
: if(n=1)
: {a[3]=1,a[4]=1;}
: if(n=2)
: {a[3]=1,a[4]=1,a[5]=1,a[6]=1,a[7]=1;} ...以此類推
: 然後用7個副函式(每個大概兩、三行)寫陣列0~6畫*
: (畫幾個* 副函式裡面寫就好了)
: 然後一個for(int i=0;i<7;i++)裡面加上if檢查a[i]
: 等於1就執行副函式
: 大概這樣
--
希望消失到自由的風中,
渴望解除掉束縛的羈絆。
期望悄悄的消失在風中,
感受那沒有羈絆的自由。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.104.29.8
※ 編輯: csihcs 來自: 59.104.29.8 (11/09 12:31)
推
11/09 22:02, , 1F
11/09 22:02, 1F
討論串 (同標題文章)