这个作业做的程序 为什么输入数据之后 加权平均分是一大堆数字串 好多位的数 还是个负的
#include
void main()
{
int A,B,C,D,E,F,G,H,I,J,K,L;
float a,b,c,d,e,f,g,h,i,j,k,l;
printf ("Please input your calculas scores:");
scanf ("%d",&A);
printf ("Please input your credit scores:");
scanf ("%f",&a);
printf ("Please input your circuit scores:");
scanf ("%d",&B);
printf ("Please input your credit scores:");
scanf ("%f",&b);
printf ("Please input your linea scores:");
scanf ("%d",&C);
printf ("Please input your credit scores:");
scanf ("%f",&c);
printf ("Please input your military theory scores:");
scanf ("%d",&D);
printf ("Please input your credit scores:");
scanf ("%f",&d);
printf ("Please input your physics scores:");
scanf ("%d",&E);
printf ("Please input your credit scores:");
scanf ("%f",&e);
printf ("Please input your English scores:");
scanf ("%d",&G);
printf ("Please input your credit scores:");
scanf ("%f",&g);
printf ("Please input your physical scores:");
scanf ("%d",&H);
printf ("Please input your credit scores:");
scanf ("%f",&h);
printf ("Please input your chemistry scores:");
scanf ("%d",&I);
printf ("Please input your credit scores:");
scanf ("%f",&i);
printf ("Please input your philosophy scores:");
scanf ("%d",&J);
printf ("Please input your credit scores:");
scanf ("%f",&j);
printf ("Please input your computer science scores:");
scanf ("%d",&K);
printf ("Please input your credit scores:");
scanf ("%f",&k);
printf ("Please input your history scores:");
scanf ("%d",&L);
printf ("Please input your credit scores:");
scanf ("%f",&l);
float sum1,sum2;
float w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12;
sum1=a+b+c+d+e+f+g+h+i+j+k+l;
w1=a/sum1;
w2=b/sum1;
w3=c/sum1;
w4=d/sum1;
w5=e/sum1;
w6=f/sum1;
w7=g/sum1;
w8=h/sum1;
w9=i/sum1;
w10=j/sum1;
w11=k/sum1;
w12=l/sum1;
sum2=A*w1+B*w2+C*w3+D*w4+E*w5+F*w6+G*w7+H*w8+I*w9+J*w10+K*w11+L*w12;
printf("credit:%6.2f,weighting total:%6.2f\n",sum1,sum2);