pesquisa

URI PROBLEMA 1005 - Média 1 EM C

URI Online Judge | 1005

Média 1

Adaptado por Neilor Tonin, URI  Brasil
Timelimit: 1
Leia 2 valores de ponto flutuante de dupla precisão A e B, que correspondem a 2 notas de um aluno. A seguir, calcule a média do aluno, sabendo que a nota A tem peso 3.5 e a nota B tem peso 7.5 (A soma dos pesos portanto é 11). Assuma que cada nota pode ir de 0 até 10.0, sempre com uma casa decimal.

Entrada

O arquivo de entrada contém 2 valores com uma casa decimal cada um.

Saída

Calcule e imprima a variável MEDIA conforme exemplo abaixo, com 5 dígitos após o ponto decimal e com um espaço em branco antes e depois da igualdade. Utilize variáveis de dupla precisão (double) e como todos os problemas, não esqueça de imprimir o fim de linha após o resultado, caso contrário, você receberá "Presentation Error".


URI Online Judge | 1005

Average 1

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Read two floating points' values of double precision A and B, corresponding to two student's grades. After this, calculate the student's average, considering that grade A has weight 3.5 and B has weight 7.5. Each grade can be from zero to ten, always with one digit after the decimal point. Don’t forget to print the end of line after the result, otherwise you will receive “Presentation Error”. Don’t forget the space before and after the equal sign.

Input

The input file contains 2 floating points' values with one digit after the decimal point.

Output

Print MEDIA(average in Portuguese) according to the following example, with 5 digits after the decimal point and with a blank space before and after the equal signal.


#include <stdio.h>

int main() {

     float x,y;
   scanf("%f %f", &x, &y);
   printf("MEDIA = %.5f\n", (x*3.5+y*7.5)/(3.5+7.5));

    return 0;
}

Postar um comentário

0 Comentários