-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path1188 - Área Inferior.cs
61 lines (50 loc) · 1.32 KB
/
1188 - Área Inferior.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
//Developed by: @LucasMarcuzo
namespace _1188___Área_Inferior
{
class Program
{
static void Main(string[] args)
{
float[,] x = new float[12,12];
char tipo;
tipo = char.Parse(Console.ReadLine().ToUpper());
for (int i = 0; i < 12; i++)
{
for (int j = 0; j < 12; j++)
{
x[i,j] = Convert.ToSingle(Console.ReadLine());
}
}
float total = 0;
for (int i = 5; i < 7; i++)
{
total += x[7,i];
}
for (int j = 4; j < 8; j++)
{
total += x[8,j];
}
for (int k = 3; k < 9; k++)
{
total += x[9,k];
}
for (int l = 2; l < 10; l++)
{
total += x[10,l];
}
for (int m = 1; m < 11; m++)
{
total += x[11,m];
}
if (tipo == 'S')
{
Console.WriteLine("{0:F1}",total);
}
else if (tipo == 'M')
{
Console.WriteLine("{0:F1}",total/30.0f);
}
}
}
}