資源簡介
用c語言畫直方圖
主要是將數(shù)據(jù)統(tǒng)計(jì)出來,然后再畫出直方圖
代碼片段和文件信息
#include
#include
main()
{
?char?*categories[]={“0““1““2““3““4““5““6““7““8““9“};
?float?a[]={310333451378};
?char??s[10];
?int?graphdriver=VGA;
?int?graphmode=VGAHIijxndxddxydy;
?initgraph(&graphdriver&graphmode“?“);
?cleardevice();
?setviewport(20206004501);
?setcolor(1);
?setbkcolor(7);
?n=10;
?dx=30;ddx=0.8*dxy=390;
?for(i=0;i<=n-1;i++)
?{
??x=dx*i+100;
??dy=a[i]*10;
??setfillstyle(1i);
??rectangle(xyx+ddxy
- 上一篇:隱藏桌面圖標(biāo)的VC程序
- 下一篇:存儲體系實(shí)驗(yàn)
評論
共有 條評論