Talent contest X59586


Statement
 

pdf   zip

thehtml

Write a program that simulates a scoring system for a talent contest with three judges. The program must read three integers between 1 and 10 representing the scores of the three judges. Based on these scores, the program must determine the type of recognition the contestant will receive and display a message on the screen:

  • average greater than or equal to 9, write the phrase " Medalla or"
  • average greater than or equal to 7 but less than 9, write the phrase " Medalla plata"
  • average greater than or equal to 5 but less than 7, write the phrase " Medalla bronze"
  • average less than 5, write the phrase " Cap premi"

Note that if two grades are the same and the third is different, the program will add or subtract one point from the average depending on whether the different grade is higher or lower than the others. If it is higher, one point is subtracted and if it is lower, it is added. Once the message has appeared on the screen, you must write down the score. An additional prize will be awarded to the competitor if all three scores are identical and he/she has won a medal. In this case, the phrase "Premi a la unanimitat" will also be written.

Exam score: 0 Automatic part: 0%

Input

The input is three integers

Output

Write a first message with the corresponding award, the final score with two decimals and, if applicable, a second message "Premi a la unanimitat", as shown in the public tests.

Note: In order for the final evaluation to be displayed with two decimal places, it is necessary to add the following lines of code just after main:
cout.setf(ios::fixed);
cout.precision(2);

Public test cases
  • Input

    9 9 9

    Output

    Medalla or
    9.00
    Premi a la unanimitat
    
  • Input

    9 8 8

    Output

    Medalla plata
    7.33
    
  • Input

    6 3 6

    Output

    Medalla bronze
    6.00
    
  • Input

    5 5 5

    Output

    Medalla bronze
    5.00
    Premi a la unanimitat
    
  • Information
    Author
    Professors PRO1
    Language
    English
    Translator
    Original language
    Catalan
    Other languages
    Catalan Spanish
    Official solutions
    C++
    User solutions
    C++