伊莉討論區

標題: c語言直方圖 問題 [打印本頁]

作者: tim24315367    時間: 2017-11-11 04:38 PM     標題: c語言直方圖 問題

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

[attach]121016306[/attach]請問一下 怎麼把  *  在printf裡面顯示(直方圖)

作者: 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才對




歡迎光臨 伊莉討論區 (http://www21.eyny.com/) Powered by Discuz!