-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (30 loc) · 1021 Bytes
/
Copy pathmain.cpp
File metadata and controls
36 lines (30 loc) · 1021 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
35
36
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
#include <cstdlib>
#include <ctime>
using std::cout;
using std::cin;
using std::endl;
void revisarTemperatura(int temperatura){
cout<<"revisando temperatura. Temperatura actual "<<temperatura<<"Cº"<<endl;
if(temperatura >= 30){
cout<<"Alerta temperatura alta"<<endl;
}
else{
cout<<"temperatura normal"<<endl;
}
}
int main()
{
srand(time(0));
int tempSimulada1 = (rand()%26) + 15;
int tempSimulada2 = (rand()%26) + 15;
revisarTemperatura(tempSimulada1);
revisarTemperatura(tempSimulada2);
return 0;
}