-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathavisos.cs
More file actions
34 lines (34 loc) · 701 Bytes
/
Copy pathavisos.cs
File metadata and controls
34 lines (34 loc) · 701 Bytes
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
using System;
class avisos {
static void Main() {
int temp = 0;
int mini = 300;
int sum = 0;
int alertas = 0;
int[] temperaturas = {85, 92, 110, 115, 120, 95, 88, 130, 145, 102};
foreach(int x in temperaturas)
{
if(x>temp)
{
temp = x;
}
if(x<mini)
{
mini = x;
}
if(x>110)
{
alertas++;
}
sum += x;
}
if(alertas>3)
{
Console.WriteLine($"La temperatura subio {alertas} veces, peligro detectado");
}
Console.WriteLine($"Temperatura mas alta fue {temp}");
Console.WriteLine($"Temperatura más baja fue {mini}");
Console.WriteLine($"La media de temperatura fue {sum/10}");
Console.WriteLine($"Números de alertas {alertas}");
}
}