Treasure the new start, freshmen! Time Limit: 1000/1000 MS (Java/Others)????Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 17877????Accepted Submission(s): 5428
Problem Description background:
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 香港vps 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 <brhsdrjb = (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. ?
Input The first number N indicate that there are N test cases(N <= 50). In each case, there is a number K (the total courses number), then K lines followed, each line would obey the format: Course-Name (Length <= 30) , Credits(<= 10), Score(<= 100).
Notice: There is no blank in the Course Name. All the Inputs are legal ?
Output Output the GPA of each case as discribed above, if the GPA is not existed, ouput:”Sorry!”, else just output the GPA value which is rounded to the 2 digits after the decimal point. There is a blank line between two test cases.?
?
Sample Input 23Algorithm 3 97DataStruct 3 90softwareProject 4 852Database 4 59English 4 81 ?
Sample Output 90.10Sorry! ?
Author zl ?
Source 校庆杯Warm Up ?
Recommend linle???|???We have carefully selected several similar problems for you:?? 2060? 2059? 2062? 2056? 2053? #include <stdlib.h>#include <stdio.h>int main(){ int s,t,i; char a[50]; double x,y; double m,n; bool f; double z; scanf(“%d”,&s); while (s–) { f = true; m = 0;n = 0; scanf(“%d”,&t); for (i=0;i<t;i++) { scanf(“%s%lf%lf”,a,&x,&y); if (y<60) f = false; m = m+x; n = n+y*x; } z = n/m; if (f) printf(“%.2lf\n”,z); else printf(“Sorry!\n”); if (s) printf(“\n”); } return 0; }
Treasure the new start freshmen
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。
相关推荐
- 香港裸金属服务器怎么样?
- HostKvm:全场八折,香港国际Kvm VPS,1核/2G内存/40G SSD硬盘/500G流量/1Gbps带宽,$6.8/月起
- Ubuntu 22.04 LTS如何升级到Ubuntu 22.10
- 搬瓦工:中国香港CN2 GIA套餐VPS可迁移至日本东京CN2 GIA等13个机房
- 小说服务器租用哪里的服务器更好?
- 速联云:美国便宜vps,三网CUVIP线路,1核/1G内存/20GB硬盘/1TB流量/200Mbps带宽,29/月,年付290元起
- 恒创科技双11活动:海外云服务器低至2.8折,香港/美国云服务器低至296元/年, 美国/香港服务器首购特价优惠
- 95IDC:香港特价CN2服务器,香港CN2站群(4c/8c)服务器促销,月付299.00 起/月