Posts

Showing posts from April, 2015

URI Online Judge | 1040 Average (Solution)

Image
Problem Link: https://www.urionlinejudge.com.br/judge/en/problems/view/1040 URI Online Judge | 1040 Average 3 Adapted by Neilor Tonin, URI   Brazil Timelimit: 1 Read four numbers (N 1 , N 2 , N 3 , N 4 ), which one with 1 digit after the decimal point, corresponding to 4 scores obtained by a student. Calculate the average with weights 2, 3, 4 e 1 respectively, for these 4 scores and print the message "Media: "  (Average), followed by the calculated result. If the average was 7.0 or more, print the message  "Aluno aprovado."  (Approved Student). If the average was less than 5.0, print the message:  "Aluno reprovado."  (Reproved Student). If the average was between 5.0 and 6.9, including these, the program must print the message "Aluno em exame." (In exam student). In case of exam, read one more score. Print the message  "Nota do exame: "  (Exam score) followed by the typed score. Recalculate the average (sum the exam score...

URI Online Judge | 1038 Snack (Solution)

Image
Problem Link: https://www.urionlinejudge.com.br/judge/en/problems/view/1038 URI Online Judge | 1038 Snack Adapted by Neilor Tonin, URI   Brazil Timelimit: 1 Using the following table, write a program that reads a code and a amount of an item. After print the value to pay. This is a very simple program with the only intention of practice of selection commands. Input The input file contains two integer numbers  X  and  Y .  X  is the product code and  Y is the quantity of this item according to the above table. Output The output must be a message "Total: R$ " followed by the total value to be paid, with 2 digits after the decimal point. Sample Input Sample Output 3 2 Total: R$ 10.00 4 3 Total: R$ 6.00 2 3 Total: R$ 13.50 Solution: #include<stdio.h> int main() {      int x,y;      scanf ( "%d %d" ,&x,&y);      switch (x) ...