HDU 2061 Treasure the new start, freshmen!
http://acm.hdu.edu.cn/showproblem.php?pid=2061
A new semester comes , and the HDU also meets its 50th birthday. No matter what's your major, the only thing I want to tell you is:"Treasure the college life and seize the time." Most people thought that the college life should be colorful, less presure.But in actual, the college life is also busy and rough. If you want to master the knowledge learned from the book, a great deal of leisure time should be spend on individual study and practise, especially on the latter one. I think the every one of you should take the learning attitude just as you have in senior school.
"No pain, No Gain", HDU also has scholarship, who can win it? That's mainly rely on the GPA(grade-point average) of the student had got. Now, I gonna tell you the rule, and your task is to program to caculate the GPA.
If there are K(K > 0) courses, the i-th course has the credit Ci, your score Si, then the result GPA is
GPA = (C1 * S1 + C2 * S2 +……+Ci * Si……) / (C1 + C2 + ……+ Ci……) (1 <= i <= K, Ci != 0)
If there is a 0 <= Si < 60, The GPA is always not existed.
Notice: There is no blank in the Course Name. All the Inputs are legal
3
#include <bits/stdc++.h>
using namespace std; int main()
{
int T;
char name[50];
double num[1111],score[1111];
scanf("%d",&T);
for(int i=1; i<=T; i++)
{
if(i!=1)
printf("\n");
int x,flag=0;
scanf("%d",&x);
double sum=0,ans=0;
for(int j=1; j<=x; j++)
{
scanf("%s%lf%lf",name,&num[j],&score[j]);
if(score[j]<60)
flag=1;
sum+=num[j]*score[j];
ans+=num[j];
}
//cout<<sum<<" "<<ans<<" "<<flag<<endl;
if(flag==0)
printf("%.2lf\n",sum/ans);
else
printf("Sorry!\n");
}
return 0;
}
HDU 2061 Treasure the new start, freshmen!的更多相关文章
- HDOJ(HDU) 2061 Treasure the new start, freshmen!(水题、)
Problem Description background: A new semester comes , and the HDU also meets its 50th birthday. No ...
- hdu2061 Treasure the new start, freshmen!(暴力简单题)
Treasure the new start, freshmen! Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/3276 ...
- HDU 3468 Treasure Hunting(BFS+网络流之最大流)
题目地址:HDU 3468 这道题的关键在于能想到用网络流.然后还要想到用bfs来标记最短路中的点. 首先标记方法是,对每个集合点跑一次bfs,记录全部点到该点的最短距离.然后对于随意一对起始点来说, ...
- hdu 2061
PS: 以为找个简单来恢复信心..结果碰到那么傻逼的题目... 题意:给出学分和成绩,算GPA...关键是注意换行....它要求的换行我觉得超级奇怪...除了第一个正常,其他的输入完之后先一个换行. ...
- HDU 3641 Treasure Hunting(阶乘素因子分解+二分)
题目链接:pid=3641">传送门 题意: 求最小的 ( x! ) = 0 mod (a1^b1*a2^b2...an^bn) 分析: 首先吧a1~an进行素因子分解,然后统计下每一 ...
- hdu 3641 Treasure Hunting 强大的二分
/** 大意:给定一组ai,bi . m = a1^b1 *a2^b2 * a3^ b3 * a4^b4*...*ai^bi 求最小的x!%m =0 思路: 将ai 质因子分解,若是x!%m=0 那么 ...
- 【网络流】 HDU 3468 Treasure Hunting
题意: A-Z&&a-z 表示 集结点 从A点出发经过 最短步数 走到下一个集结点(A的下一个集结点为B ,Z的下一个集结点为a) 的路上遇到金子(*)则能够捡走(一个点仅仅能捡一次) ...
- HDU100题简要题解(2060~2069)
这十题感觉是100题内相对较为麻烦的,有点搞我心态... HDU2060 Snooker 题目链接 Problem Description background: Philip likes to pl ...
- hdu2060-2062
hdu 2060 斯诺克,读懂题意直接模拟 #include<stdio.h> int main(){ int N; ]; a[]=; ;i<=;i++){ a[i]=(-i)*i/ ...
随机推荐
- 20145209刘一阳《JAVA程序设计》第十五周补充测试
第十五周补充测试 1.实验楼Linux中可以通过(ABC)查看用户登录情况. A .who B .who am i C .who mom likes D .who are you 2.在 Linux ...
- [arc072F]Dam-[单调队列]
Description 传送门 Solution 首先我们肯定不能那么耿直地直接把水混合起来吧..不然分分钟完球. 那么怎么找到最优解呢?假如我们把水的体积和温度按顺序插入队列,这时我们插入第i天的水 ...
- 使用Python代码处理Excel
转载说明: 原文地址:http://my.oschina.net/alazyer/blog/223354 原文有十处左右的错误,修正后转载于此. 经验证,python 3.4.3下可用.请各位朋友明察 ...
- jmeter no-gui模式动态传递场景参数
jmeter进行性能压测时,有时候需要在linux上no-gui模式下运行,为了在no-gui模式下更方便的设置脚本的运行的场景, 将脚本的线程数,运行时间设置为动态参数,可以在脚本运行时动态设置“线 ...
- Navigation - How to define the structure of the navigation tree via the NavigationItemAttribute
In the meantime, you should use the Model Editor to create such a navigation structure. There are se ...
- 手动搭建openstack的痛苦经历
openstack真的是一个十分痛苦的东西,好在有自动部署工具,虽然有自动部署工具可以方便我们部署使用,但是学习的话,第一次最好手动部署,因为手动部署更能我们了解openstack的工作流程和各组建之 ...
- 通过iLO进行Zabbix监控——针对HP服务器集成
iLO 全名是 Integrated Lights-out,它是惠普某些型号的服务器上集成的远程管理端口,它能够允许用户基于不同的操作系统从远端管理服务器,实现了虚拟存在和控制,从而进行智能型基础构架 ...
- AtCoder | ARC102 | 瞎讲报告
目录 ARC102 前言 正文 传送链接~ ARC102 前言 实在是太菜了....写完第一题就弃疗..感觉T3好歹也是道可做题吧!!然后T2怎么又是进制拆分! 正文 A 题意 给你两个数字\(n,k ...
- Docker入门与实践之 Dockerfile 语法详解
一.Dockerfile 概述 Dockerfile是docker程序的解释脚本文件,Dockerfile 是一条一条的指令,Docker程序将dockerfile中的一条条指令编译成Linux可执行 ...
- 字幕字体滚动插件——scroxt.js
README scroxt.js Overview scroxt.js是一个字体滚动的插件库,包括视频弹幕滚动,直播弹幕.直播弹幕强制模式.单行水平左右滚动.文本垂直滚动上下,用于简单快捷生成滚动字体 ...