hdu 1202 The calculation of GPA
来源:互联网 发布:推荐信 出国留学 知乎 编辑:程序博客网 时间:2024/05/18 22:11
题目:点击打开链接
题目不难,读懂题意就行,
代码有错误,还没AC,想看阅兵
#include<cstdio>#include<cstring>#include<cmath>#include<iostream>using namespace std;int main(){ int n,m; float s,p,ans=0,sum=0; while(scanf("%d",&n)!=EOF) { for(int i=0;i<n;i++) { cin>>s>>p; if(p>=90&&p<=100) m=4; else if(p>=60&&p<=69) m=1; else if(p>=70&&p<=79) m=2; else if(p>=80&&p<=89) m=3; else m=0; if(p==-1) { ans=0; sum=0; break; } ans+=s; sum+=s*m; } if(ans==0||sum==0) printf("-1\n"); else printf("%.2lf\n",sum/ans); } return 0;}
0 0
- HDU 1202 The calculation of GPA
- hdu 1202 The calculation of GPA
- HDU 1202 The calculation of GPA
- HDU 1202 The calculation of GPA
- HDU 1202 The calculation of GPA
- HDU 1202 The calculation of GPA
- hdu-1202-The calculation of GPA
- hdu 1202 The calculation of GPA
- HDU 1202 The calculation of GPA
- hdu 1202 The calculation of GPA
- hdu 1202 The calculation of GPA
- hdu 1202 The calculation of GPA
- hdu-1202 The calculation of GPA
- HDU 1202 The calculation of GPA
- HDU 1202 The calculation of GPA
- HDU 1202 The calculation of GPA
- The calculation of GPA HDU
- The calculation of GPA 1202
- 中断处理函数
- OpenGL GLSL访问纹理
- android里.getText().tostring()怎么用
- 聚类算法与贪心算法
- IOS deletate assign
- hdu 1202 The calculation of GPA
- 归并排序
- 开发中多条件搜索是使用StringBuilder创建sql语句
- mmap系统调用
- Qt特殊符号
- 在Mac OS X上面指定Eclipse启动时用指定的某一版本JDK
- simplexml
- Cocos2dx核心概念
- iOS开发十大必备开源框架