> For the complete documentation index, see [llms.txt](https://xtecna.gitbook.io/solucoes-da-beecrowd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xtecna.gitbook.io/solucoes-da-beecrowd/iniciante/1005-media-1.md).

# 1005 - Média 1

Um problema simples de média ponderada.

## Descrição

{% embed url="<https://www.urionlinejudge.com.br/judge/pt/problems/view/1005>" %}

## Solução

Uma coisa engraçada desse exercício que os pesos não somam 10 e, por isso, as médias de notas de 0 a 10 na verdade vão de 0 a 11.

{% tabs %}
{% tab title="C99" %}

```c
#include <stdio.h>

int main(){
    double A, B, media;

    scanf("%lf\n%lf", &A, &B);

    media = (3.5 * A + 7.5 * B)/11.0;

    printf("MEDIA = %.5lf\n", media);

    return 0;
}
```

{% endtab %}

{% tab title="C++17" %}

```cpp
#include <iostream>
#include <iomanip>

using namespace std;

int main(){
    double A, B, media;

    cin >> A >> B;

    media = (3.5 * A + 7.5 * B)/11.0;

    cout << "MEDIA = " << setprecision(5) << fixed << media << endl;

    return 0;
}
```

{% endtab %}

{% tab title="JavaScript 12.18" %}

```javascript
let input = require("fs").readFileSync("/dev/stdin", "utf8");
let lines = input.split("\n");

let A = parseFloat(lines.shift());
let B = parseFloat(lines.shift());

let media = (3.5 * A + 7.5 * B) / 11;

console.log(`MEDIA = ${media.toFixed(5)}`);
```

{% endtab %}

{% tab title="Python 3.9" %}

```python
A = float(input())
B = float(input())

media = (3.5 * A + 7.5 * B)/11

print(f"MEDIA = {media:.5f}")
```

{% endtab %}
{% endtabs %}
