HDUOJ-----2399GPA
GPA
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2310 Accepted Submission(s): 1359
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
char str;
int cnt=,con=;
bool flag=true;
while(scanf("%c",&str)!=EOF)
{
if(str==) continue;
if(str==)
{
if(flag)
printf("%.2lf\n",(double)1.0*cnt/con);
else
printf("Unknown letter grade in input\n");
flag=true;
con=;
cnt=;
continue;
}
switch(str)
{
case 'A': cnt+=; break;
case 'B': cnt+=; break;
case 'C': cnt+=; break;
case 'D': cnt++; break;
case 'F': break;
default: flag=false; break;
}
con++;
}
return ;
}
HDUOJ-----2399GPA的更多相关文章
- hduoj 1455 && uva 243 E - Sticks
http://acm.hdu.edu.cn/showproblem.php?pid=1455 http://uva.onlinejudge.org/index.php?option=com_onlin ...
- hduoj 4712 Hamming Distance 2013 ACM/ICPC Asia Regional Online —— Warmup
http://acm.hdu.edu.cn/showproblem.php?pid=4712 Hamming Distance Time Limit: 6000/3000 MS (Java/Other ...
- hduoj 4706 Herding 2013 ACM/ICPC Asia Regional Online —— Warmup
hduoj 4706 Children's Day 2013 ACM/ICPC Asia Regional Online —— Warmup Herding Time Limit: 2000/1000 ...
- hdu-oj 1874 畅通工程续
最短路基础 这个题目hdu-oj 1874可以用来练习最短路的一些算法. Dijkstra 无优化版本 #include<cstdio> #include<iostream> ...
- C#版 - HDUoj 5391 - Zball in Tina Town(素数) - 题解
版权声明: 本文为博主Bravo Yeung(知乎UserName同名)的原创文章,欲转载请先私信获博主允许,转载时请附上网址 http://blog.csdn.net/lzuacm. HDUoj 5 ...
- C++版 - HDUoj 2010 3阶的水仙花数 - 牛客网
版权声明: 本文为博主Bravo Yeung(知乎UserName同名)的原创文章,欲转载请先私信获博主允许,转载时请附上网址 http://blog.csdn.net/lzuacm. C++版 - ...
- HDUOJ题目HTML的爬取
HDUOJ题目HTML的爬取 封装好的exe/app的GitHub地址:https://github.com/Rhythmicc/HDUHTML 按照系统选择即可. 其实没什么难度,先爬下来一个题目的 ...
- hduoj 1251 统计难题
http://acm.hdu.edu.cn/showproblem.php?pid=1251 统计难题 Time Limit: 4000/2000 MS (Java/Others) Memory ...
- hduoj 1286 找新朋友
http://acm.hdu.edu.cn/showproblem.php?pid=1286 找新朋友 Time Limit: 2000/1000 MS (Java/Others) Memory Li ...
- hduoj 1285 确定比赛名次
http://acm.hdu.edu.cn/showproblem.php?pid=1285 确定比赛名次 Time Limit: 2000/1000 MS (Java/Others) Memory ...
随机推荐
- Android中RelativeLayout和LinearLayout性能分析
先看一些现象吧:用eclipse或者Android studio,新建一个Activity自动生成的布局文件都是RelativeLayout,或许你会认为这是IDE的默认设置问题,其实不然,这是由 a ...
- UI_UITabBarController
建立控制器 // 普通控制器 GroupViewController *groupVC = [[GroupViewController alloc] init]; SecondViewControll ...
- 第六章 字节码执行方式--解释执行和JIT
注:主要参考自<分布式java应用:基础与实践><深入理解Java虚拟机(第二版)> 1.两种执行方式: 解释执行(运行期解释字节码并执行) 强制使用该模式:-Xint 编译为 ...
- SQL Server基础知识三十三问 (7-14)
8. 一般什么时候使用update_statistics命令? 答: 这个命令基本上是在很多数据被处理过了之后才使用的. 如果大量的删除, 修改, 或这大量的数据插入已经发生了, 那么index就需 ...
- [Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined、vuejs路由使用的问题Error in render function
1.[Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined 注意,只要出现Error i ...
- CloudStack无法添加模板和iso
做了N久的CloudStack二次开发,最近越来越多的人开始使用CloudStack. 通常会遇到添加模板和iso不成功的问题. 表现为注册了template/iso之后,"已就绪" ...
- WebApi的缺点
post只能传递对象 必须要参数一致,不能同名称
- loadicon后一定要调用destroyicon吗
Remarks It is only necessary to call DestroyIcon for icons and cursors created with the following fu ...
- [Node.js]23. Level 4: Semantic versioning
Update the versions on your dependencies to be a little more flexible, adding the ~ in front of your ...
- 【已解决】Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
转自:http://www.crifan.com/python_syntax_error_indentationerror/comment-page-1/ [问题] 一个python脚本,本来都运行好 ...