#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n,k;
    double gpa,s,credit,score;
    string name;
    bool flag = true;
    cin >> n;
    while (n--)
    {
        cin >> k;
        gpa = 0.0;
        s = 0.0;
        flag = true;
        for (int i = 1; i <= k; i++)
        {
            cin >> name >> credit >> score;
            gpa += credit * score;
            s += credit;
            if (60 - score >0.000001)
                flag = false;
        }
        
        gpa = gpa *1.0/ s;
        if (flag)
            printf("%.2lf\n", gpa);
        else
            printf("Sorry!\n");

        if (n != 0)
            printf("\n");
    }
    return 0;
}

 

相关文章:

  • 2021-10-31
  • 2021-09-08
  • 2021-04-20
  • 2021-06-21
  • 2022-02-12
  • 2022-02-21
  • 2021-10-06
  • 2021-07-09
猜你喜欢
  • 2022-12-23
  • 2021-12-01
  • 2021-10-20
  • 2021-12-29
  • 2021-09-16
  • 2021-11-04
  • 2022-12-23
相关资源
相似解决方案