UVA Problem 11777 Solution – Automate the Grades

Problem Solving, UVa

 

#include <bits/stdc++.h>



using namespace std;

int main()

{

    int t1,t2,f,a,ct1,ct2,ct3,sum,avr,c,t;

    cin>>t;

    for(c=0;c<t;c++)

    {

    sum=0;



    cin>>t1>>t2>>f>>a>>ct1>>ct2>>ct3;

    {

   

    if(ct1<=ct2 && ct1<=ct3)

   

    avr=(ct2+ct3)/2;

   

     if(ct2<=ct1 && ct2<=ct3)

   

    avr=(ct1+ct3)/2;

   

     if(ct3<=ct1 && ct3<=ct2)

   

    avr=(ct1+ct2)/2;

   

    sum=t1+t2+f+a+avr;

   

    if(sum>=90)

   

    printf("Case %d: A\n",c+1);

   

    else if(sum>=80)

   

    printf("Case %d: B\n",c+1);

   

    else if(sum>=70)

   

    printf("Case %d: C\n",c+1);

   

    else if(sum>=60)

   

    printf("Case %d: D\n",c+1);

   

    else if(sum<60)

   

    printf("Case %d: F\n",c+1);

           

    }   

    }

    return 0;

}

 

0 Comments

You may find interest following article

Complete Guide: Create Laravel Project in Docker Without Local Dependencies

Create Laravel Project Through Docker — No Need to Install PHP, MySQL, or Apache on Your Local Machine In this tutorial, I’ll show you how to create and run a full Laravel project using Docker containers. That means you won’t have to install PHP, MySQL, or Apache locally on your computer. By the end of this guide, you’ll have a fully functional Laravel development...