# 1012 - Área

## Descrição

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

## Solução

As fórmulas que você pode usar são:

$$
\text{Área do Triângulo} = \frac{A \times C}{2}
$$

$$
\text{Área do Círculo} = \pi \times C^{2}
$$

$$
\text{Área do Trapézio} = \frac{A + B}{2} \times C
$$

$$
\text{Área do Quadrado} = B \times B
$$

$$
\text{Área do Retângulo} = A \times B
$$

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

```c
#include <stdio.h>

int main(){
    double A, B, C;
    const double PI = 3.14159;

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

    printf("TRIANGULO: %.3lf\n", (A * C)/2.0);
    printf("CIRCULO: %.3lf\n", PI * C * C);
    printf("TRAPEZIO: %.3lf\n", (A + B)/2.0 * C);
    printf("QUADRADO: %.3lf\n", B * B);
    printf("RETANGULO: %.3lf\n", A * B);

    return 0;
}
```

{% endtab %}

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

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

using namespace std;

int main(){
    double A, B, C;
    const double PI = 3.14159;

    cin >> A >> B >> C;

    cout << "TRIANGULO: " << setprecision(3) << fixed << (A * C)/2.0 << endl;
    cout << "CIRCULO: " << setprecision(3) << fixed << PI * C * C << endl;
    cout << "TRAPEZIO: " << setprecision(3) << fixed << (A + B)/2.0 * C << endl;
    cout << "QUADRADO: " << setprecision(3) << fixed << B * B << endl;
    cout << "RETANGULO: " << setprecision(3) << fixed << A * B << endl;

    return 0;
}
```

{% endtab %}

{% tab title="JavaScript 12.18" %}

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

const PI = 3.14159;

let [A, B, C] = lines.shift().split(" ").map((x) => parseFloat(x));

const areaTriangulo = (A * C) / 2;
const areaCirculo = PI * C * C;
const areaTrapezio = ((A + B) / 2) * C;
const areaQuadrado = B * B;
const areaRetangulo = A * B;

console.log(`TRIANGULO: ${areaTriangulo.toFixed(3)}`);
console.log(`CIRCULO: ${areaCirculo.toFixed(3)}`);
console.log(`TRAPEZIO: ${areaTrapezio.toFixed(3)}`);
console.log(`QUADRADO: ${areaQuadrado.toFixed(3)}`);
console.log(`RETANGULO: ${areaRetangulo.toFixed(3)}`);
```

{% endtab %}

{% tab title="Python 3.9" %}

```python
PI = 3.14159

A, B, C = [float(x) for x in input().split(' ')]

areaTriangulo = (A * C)/2
areaCirculo = PI * C * C
areaTrapezio = (A + B)/2 * C
areaQuadrado = B * B
areaRetangulo = A * B

print(f"TRIANGULO: {areaTriangulo:.3f}")
print(f"CIRCULO: {areaCirculo:.3f}")
print(f"TRAPEZIO: {areaTrapezio:.3f}")
print(f"QUADRADO: {areaQuadrado:.3f}")
print(f"RETANGULO: {areaRetangulo:.3f}")
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xtecna.gitbook.io/solucoes-da-beecrowd/iniciante/1012-area.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
