查看完整版本: c語言直方圖 問題
頁: [1]

tim24315367 發表於 2017-11-11 04:38 PM

c語言直方圖 問題

本帖最後由 tim24315367 於 2017-11-11 04:39 PM 編輯

請問一下 怎麼把  *  在printf裡面顯示(直方圖)
<div></div>

exlater 發表於 2017-11-24 12:17 AM

For a simple answer, just
(1) remove \n
(2) use for-loop to print *
(3) print nextline

For a advance answer:
You have to think if the "a1" > "b2" and "a1" is large than the window size,
Can we prevent to print a1 more than one line?
You can think about that

z1090128 發表於 2017-11-25 10:40 AM

在printf裡面直接''***''應該是可以
另外if裡面應該是不用放break才對
頁: [1]