水题。

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std; double totsum,totnum,k;
char s[];
int n; double get()
{
if (s[]=='A')
{
if (s[]==) return ;
else return 3.7;
}
if (s[]=='B')
{
if (s[]==) return ;
else if (s[]=='+') return 3.3;
else return 2.7;
}
if (s[]=='C')
{
if (s[]==) return ;
else if (s[]=='+') return 2.3;
else return 1.7;
}
if (s[]=='D')
{
if (s[]==) return 1.3;
else return ;
}
if (s[]=='F') return ;
return -;
} int main()
{
while (scanf("%d",&n)!=EOF)
{
totsum=totnum=;
while (n--)
{
scanf("%lf%s",&k,s);
double tep=get(); //cout<<" this is : "<<tep<<endl;
if (tep<) continue;
totnum+=k;
totsum+=k*tep;
}
if (totnum==) printf("0.00\n");
else printf("%.2f\n",totsum/totnum);
}
return ;
}

最新文章

  1. tomcat启动报错No UserDatabase component found under key UserDatabase
  2. caffe:用自己的数据训练网络mnist
  3. win7下vs2010编译生成sqlite3.dll库
  4. NOR FLASH与NAND FLASH的区别
  5. Android图像处理2
  6. 2015前端各大框架比较(angular,vue,react,ant)
  7. 如何获取App当前版本号
  8. C#读取Word文档内容代码
  9. HDU-1428(记忆化搜索)
  10. genymotion+Oracle VM VirtualBox + eclipse + appium 脚本运行慢解决步骤
  11. 深度理解div+css布局嵌套盒子
  12. 【Ubuntu 16】安装deb
  13. 请注意写代码的习惯与态度(Java)
  14. java 设计模式 ---- 单例模式
  15. Egret的Shape
  16. 关于Fatal error: Paletter image not supported by webp 报错
  17. 20165234 《Java程序设计》第二周学习总结
  18. c/C++编译的程序占用的内存分为以下几个部分
  19. zabbix3监控php-fpm的状态
  20. 【Linux】解决&quot;no member named &#39;max_align_t&#39;

热门文章

  1. 20155321 《Java程序设计》实验三 敏捷开发与XP实践
  2. 20145207《Java程序设计》实验二(Java面向对象程序设计)实验报告
  3. 1150: [CTSC2007]数据备份Backup
  4. svn 配置仓库
  5. 「日常训练」Jongmah(Codeforces-1110D)
  6. MySQL☞视图
  7. 如何选择 .NET Framework目标版本
  8. Linux建立互信关系(ssh公钥登录)
  9. hadoop之mapper类妙用
  10. 3.hive的thriftserver服务