PS:  以为找个简单来恢复信心..结果碰到那么傻逼的题目...

题意:给出学分和成绩,算GPA...关键是注意换行....它要求的换行我觉得超级奇怪...除了第一个正常,其他的输入完之后先一个换行..//为什么要这样换行..?反正我是看了AC代码才知道要这样换行...

贴上自己的代码...

代码:

#include "stdio.h"
int main(){
double c[],s[],flag1,sum,sum1;
int T,i,j,n,flag,space=;
scanf("%d%*c",&T);
while(T--){
scanf("%d",&n);
sum=0.0;
sum1=0.0;
flag=;
for(i=;i<n;i++){
scanf("%*s%lf%lf%*c",&c[i],&s[i]);
if(s[i]< && s[i]>=) flag=;
sum+=(c[i]*s[i]);
sum1+=c[i];
}
if (space ++ != ) printf ("\n") ;
if(flag == || sum1 == ){
printf("Sorry!\n");
continue;
}
flag1=sum/sum1;
printf("%.2lf\n",flag1);
}
return ;
}

hdu 2061的更多相关文章

  1. HDU 2061 Treasure the new start, freshmen!

    http://acm.hdu.edu.cn/showproblem.php?pid=2061 Problem Description background:A new semester comes , ...

  2. HDOJ(HDU) 2061 Treasure the new start, freshmen!(水题、)

    Problem Description background: A new semester comes , and the HDU also meets its 50th birthday. No ...

  3. hdu2060-2062

    hdu 2060 斯诺克,读懂题意直接模拟 #include<stdio.h> int main(){ int N; ]; a[]=; ;i<=;i++){ a[i]=(-i)*i/ ...

  4. HDU——PKU题目分类

    HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...

  5. [转] HDU 题目分类

    转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...

  6. HDU ACM 题目分类

    模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...

  7. (并查集)Travel -- hdu -- 5441(2015 ACM/ICPC Asia Regional Changchun Online )

    http://acm.hdu.edu.cn/showproblem.php?pid=5441 Travel Time Limit: 1500/1000 MS (Java/Others)    Memo ...

  8. HDU 5643 King's Game 打表

    King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...

  9. 转载:hdu 题目分类 (侵删)

    转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...

随机推荐

  1. 反编译工具reflector破解方法

    文件下载:http://files.cnblogs.com/lori/Red.Gate.Reflector7.6.rar 破解方法: 1. 断网2. 运行.NET Reflector,点击Help - ...

  2. #Javascript:this用法整理

    常用Javascript的人都知道,[this這個關鍵字在一個函式內究竟指向誰]的這個問題很令人頭大,本人在這裡整理了一下Javascript中this的指向的五種不同情況,其中前三種屬於基本的情況, ...

  3. HDU-----(4858)项目管理(模拟)

    项目管理 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  4. Uva----------(11078)Open Credit System

    Open Credit System Input:Standard Input Output: Standard Output In an open credit system, the studen ...

  5. la----3695 City Game(最大子矩阵)

    Bob is a strategy game programming specialist. In his new city building game the gaming environment ...

  6. 190. Reverse Bits -- 按位反转

    Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in ...

  7. hdu5878 I Count Two Three(二分+ 打表)

    题目链接:hdu5878 I Count Two Three 题意:给出一个整数n, 找出一个大于等于n的最小整数m, 使得m可以表示为2^a * 3^b * 5^c * 7^d​​. 题解:打表预处 ...

  8. SAP采购订单审批记录增强

    采购订单审核函数: BAPI_PO_RELEASE 结尾加上 ENHANCEMENT ZME28_PO. "active version DATA:LS_EKKO TYPE EKKO. DA ...

  9. SQL SERVER 2008安装错误(is not a valid login or you do have permission)

    在网上搜索查找问题: 原因:[计算机名] 与[账号名称]名称一致. 解决方案: 修改计算机名 桌面 -> 我的电脑 -> 右鍵点击属性 -> 选择计算机名选项卡 -> 更改 - ...

  10. 镜像渐变-radio-gradient

    2013年11月15日13:08:37   <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"&g ...