-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path017.cs
42 lines (32 loc) · 954 Bytes
/
017.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Desafio 017
Problema: Faça um programa que leia o comprimento do cateto oposto (co) e
do cateto adjacente (ca) de um triângulo retângulo, calcule e mostre
o comprimento da hipotenusa
Resolução do problema:
*/
using System;
static class io {
public static string input(string text) {
Console.Write(text);
return Console.ReadLine();
}
public static void print(object data, string end="\n") {
string text = data.ToString();
Console.Write($"{text}{end}");
}
}
class Program {
public static void Main() {
double oposto = double.Parse(
io.input("Informe o cateto oposto: ")
);
double adjacente = double.Parse(
io.input("Informe o cateto adjacente: ")
);
double hipotenusa = Math.Sqrt(
Math.Pow(oposto, 2) + Math.Pow(adjacente, 2)
);
io.print($"Hipotenusa {hipotenusa}");
}
}