-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (28 loc) · 931 Bytes
/
main.cpp
File metadata and controls
48 lines (28 loc) · 931 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
37
38
39
40
41
42
43
44
45
46
47
48
#include <iostream>
#include "Pokemon.h"
#include "Fraccion.h"
using namespace std;
int main()
{
Pokemon pika = crearPokemon("pikachu");
cout << "Mi nombre es: " << getNombre(pika) << endl;
cambiarNombre(pika, "bruno");
cout << "Mi nombre es: " << getNombre(pika) << endl;
cout << "Cantidad de vida: " << getVida(pika) << endl;
cout << "esta vivo: " << estaVivo(pika) << endl;
restarVida(pika);
cout << "esta vivo: " << estaVivo(pika) << endl;
destruir(pika);
//---------FRACCIONES----------//
cout << "Creo dos fracciones... " << endl;
Fraccion f = fraccion(1, 2);
Fraccion g = fraccion(1, 1);
cout << "numerador: "<< num(f) << endl;
cout << "denominador: "<< den(f) << endl;
cout << "hago la suma" << endl;
Fraccion sum = sumar(f,g);
cout << "suma: "<< endl;
cout << "numerador: "<< num(sum) << endl;
cout << "denominador: "<< den(sum) << endl;
return 0;
}