-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathL2_q2.c
62 lines (58 loc) · 939 Bytes
/
L2_q2.c
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include<stdio.h>
//1FAC - Lista II - QUESTÃO 02
int main()
{
float peso, numero;
//obter peso
printf("Insira o peso:\n");
scanf("%f", &peso);
//obter numero do planeta
printf("Insira um numero(1-6):\n");
scanf("%f", &numero);
//se o numero for igual a 1
if(numero==1)
{
printf("%.1f\n", peso*0.37);
}
//senao
else
{
//se o numero for igual a 2
if(numero==2)
{
printf("%.1f\n", peso*0.88);
}
//senao
else
{
//se o numero for igual a 3
if(numero==3)
{
printf("%.1f\n", peso*0.38);
}
//senao
else
{
//se o numero for igual a 4
if(numero==4)
{
printf("%.1f\n", peso*2.64);
}
//senao
else
{
//se o numero for igual a 5
if(numero==5)
{
printf("%.1f\n", peso*1.15);
}
//senao
else
{
printf("%.1f\n", peso*1.17);
}
}
}
}
}
}