1778 credit points and

Source: Internet
Author: User

 

Description

Credit points and are the main basis for the final ranking of Beijing University of Aeronautics and Astronautics. Their calculation rules are to multiply the credits of each required course by the scores obtained from this course. The formula for calculating the scores of each course is as follows:

If the score is greater than or equal to 90, the score is recorded as 1.5.

If the score is greater than or equal to 80 and less than 90, the score is 1.3.

If the score is greater than or equal to 70 and less than 80, the score is 1.1.

If the score is greater than or equal to 60 and less than 70, the score is 1.0.

If the score is less than 60, the score is 0.0.

The excellent, good, medium, pass, and fail scores of sports compulsory (and sports extracurricular) correspond to 1.5, 1.3, 1.1, 1.0, and 0 respectively.

Because the score is given by the teachers of different subjects, the final time for each subject is usually different. Some time sb. knows the score of several subjects, so please help calculate his/her average score and what is it?

To simplify the problem, physical education classes are not considered here.

By the way, I forgot to say that the average point and two decimal places are retained ).

Input

Multiple groups of data, the first behavior data group T

For each group of data, the first is a number N, indicating sb. I already know the scores of N subjects, followed by N pairs of real AI, Bi for the n subjects of credits and Sb..

Output

For each group of data, a row is output as a real number, indicating the average performance point and Sb.

Solution: This is a simulated question. Pay attention to the interval to make a judgment. Add the corresponding score points.

 

#include <iostream>#include <cstdio>using namespace std;int main(){int number;double sum,c;int a,b;cin>>number;for(int i=0;i<number;i++){int temp;sum=0;cin>>temp;for(int j=0;j<temp;j++){cin>>a>>b;if(b>=90)c=1.5;else{if(b>=80)c=1.3;else{if(b>=70)c=1.1;else{if(b>=60)c=1.0;elsec=0;}}}          sum+=a*c;}printf("%.2lf\n",sum);}return 0;}

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.