真是让各位见笑了 我找到错误了
少打了f的一段 麻烦各位了
大家帮忙看一看 很急的
这个作业做的程序 为什么输入数据之后 加权平均分是一大堆数字串 好多位的数 还是个负的
#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);
- 点赞
- 写回答
- 关注问题
- 收藏
- 复制链接分享
- 邀请回答
7条回答
为你推荐
- 请大家帮忙改正,非常感谢。急急急
- python
- 1个回答
- 急!ActiveMQ集群启动失败 No IOExceptionHandler registered, ignoring IO exception
- 请大家帮忙,关于tabpanel title样式的问题,急
- ext
- 0个回答
- 问一个jbpm的入门级问题,在线急等。。。
- jboss
- 0个回答
- 写一个方法求集合的比值,请大家帮忙!!!
- 企业应用
- 0个回答
- 关于tomcat6+dbcp的配置问题,急请大家帮忙
- 数据库
- 0个回答
- 上传工程请大家帮忙看下问题,谢谢
- dwr
- 0个回答
- 还是JS 取得上一页的问题,大家帮忙解答下!!!很急
- 企业应用
- 0个回答
- 小弟有一个问题很急啊
- 企业应用
- 0个回答
- jsp被shift+delete调了,急恢复
- 项目管理
- 0个回答
- java读取gif图片后,重新写一个gif图片,此图片没有动画效果
- 企业应用
- 0个回答
- jsp中一个java的字符串数组如何传值给javascript????? 急
- javascript
- 0个回答
- 大家帮忙看一看 很急的
- c++
- 7个回答
- 急!!求大神帮忙看一下以下代码需要改哪部分
- js 急!!!
- 1个回答
- 病毒侵袭
- 源码
- 1个回答
- 急最好这两天有答案D7~D0 由左向右,每次仅亮一个灯,循环显 示,D15~D8 与 D7~D0 正相反
- 数据灯
- 5个回答
- 关于一个简单的代理服务器程序,运行程序出现错误,求解答,新手无从入手啊
- 2个回答
- 急啊,困扰一周了,gridview选中一行进行编辑
- c#
- 4个回答
- 急急急!seasar的JdbcManager的问题,请大神帮忙啊!
- java
- jdbcmanage...
- seasar
- enum
- 2个回答
- 急、QPainter 会的进来帮忙下
- c++
- qpainter
- qt
- 1个回答