2008
01-22

为何黑屏不能运行啊!


万分感谢


#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <graphics.h>



main(){


int m1=0,m2=0,m3=0,m4=0,m5=0;
int stu[38];
int i;


int gdriver=DETECT, gmode;



float r=50.0,q;
for(i=0;i<=37;i++)
scanf(“%d”,&stu[i]);


for(i=0;i<=37;i++)
if(stu[i]>=90) m1++;
else if(stu[i]>=80) m2++;
else if(stu[i]>=70) m3++;
else if(stu[i]>=60) m4++;
else m5++;


initgraph(&gdriver, &gmode, “”);


cleardevice();
setbkcolor(0);
setcolor(0);
circle(400,120,r);



setcolor(2); /*饼状图*/
for(q=0.0;q<=50;q+=0.1)
arc(400,120,0,m1*12,q);
setcolor(3);
for(q=0.0;q<=50;q+=0.1)
arc(400,120,m1*12,(m1+m2)*12,q);
setcolor(5);
for(q=0.0;q<=50;q+=0.1)
arc(400,120,(m1+m2)*12,(m1+m2+m3)*12,q);
setcolor(6);
for(q=0.0;q<=50;q+=0.1)
arc(400,120,(m1+m2+m3)*12,(m1+m2+m3+m4)*12,q);
setcolor(14);
for(q=0.0;q<=50;q+=0.1)
arc(400,120,(m1+m2+m3+m4)*12,360,q);


closegraph();
}


留下一个回复