wikioi 1023 GPA计算
2013-12-03 21:51
309 查看
http://wikioi.com/problem/1023/
关键就是这个算式的理解
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
int n;
double a,b;
int main()
{
cin>>n;
double t1=0.0,t2=0.0;
for(int i=1;i<=n;i++)
{
cin>>a>>b;
t1=t1+a;
t2+=a*b;
}
printf("%.2lf\n",t2/t1);
return 0;
}
关键就是这个算式的理解
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
int n;
double a,b;
int main()
{
cin>>n;
double t1=0.0,t2=0.0;
for(int i=1;i<=n;i++)
{
cin>>a>>b;
t1=t1+a;
t2+=a*b;
}
printf("%.2lf\n",t2/t1);
return 0;
}
相关文章推荐
- 1023 GPA计算
- CODE[VS]1023 GPA计算
- [codevs]1023 GPA计算
- 【CodeVS】1023 GPA计算
- 【CodeVS】1023 GPA计算
- 【codevs 1023】GPA计算
- 1023 GPA计算
- HDU 2061 Treasure the new start, freshmen!(GPA的计算)
- ACM--AOJ计算GPA
- GPA计算
- 什么是GPA,应如何计算?
- acmore.cc|acmore.cc1021科学方面:计算能量1022科学方面:风寒温度1023打印表格1024字符转换1025几何方面:两点间的距离
- wikioi1011 数的计算 (2001年NOIP全国联赛普及组)
- wikioi 1011 数的计算
- 什么是GPA,应如何计算?
- 一个计算GPA的工具
- 1023 例题3-2 计算存款利息
- HDU 1023 Train Problem II 找规律 大数计算
- wikioi天梯 1011 数的计算 (记忆化递归)
- 用Excel计算加权平均分和GPA