📄 1202.cpp
字号:
#include<iostream>
#include<cstdio>
using namespace std;
double mark[50000];
double scor[50000];
void main()
{
double total,full;
int n, i ,temp;
while(cin>>n){
total = 0;
full = 0;
for(i = 0;i < n;i++){
cin>>scor[i]>>mark[i];
if(mark[i] != -1){
total += scor[i];
if(mark[i] >= 60){
if(mark[i] == 100)
full += 4*scor[i];
else{
temp = mark[i]-50;
full += temp/10*scor[i];
}
}
}
}
if(total > 0)
printf("%.2lf\n",full/total);
else if(total == 0)
cout<<"-1"<<endl;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -