Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <iostream>
- using namespace System;
- using namespace std;
- void input(int *a, int *b, int *c)
- {
- char *ordMas;
- ordMas = new char;
- *ordMas = 167; // ยบ
- cout << "Ingrese los tres numeros:" << endl << "1" << *ordMas << " : ";
- cin >> *a;
- cout << "2" << *ordMas << " : ";
- cin >> *b;
- cout << "3" << *ordMas << " : ";
- cin >> *c;
- delete ordMas;
- }
- void calcularMinMax(int a, int b, int c, int *mayor, int *menor)
- {
- if ( a > b && a >c)
- {
- *mayor = a;
- }
- else if (b > a && b > c)
- {
- *mayor = b;
- }
- else if (c > a && c > b)
- {
- *mayor = c;
- }
- if (a < b && a < c)
- {
- *menor = a;
- }
- else if (b < a && b < c)
- {
- *menor = b;
- }
- else if (c < a && c < b)
- {
- *menor = c;
- }
- }
- void output(int *mayor, int *menor)
- {
- cout << "El numero mayor es: " << *mayor << ", con la direccion: " << mayor << endl;
- cout << "El numero menor es: " << *menor << ", con la direccion: " << menor;
- }
- int main()
- {
- int *num1, *num2, *num3 , *max, *min;
- num1 = new int;
- num2 = new int;
- num3 = new int;
- max = new int;
- min = new int;
- input(num1, num2, num3);
- calcularMinMax(*num1, *num2, *num3, max, min);
- output(max, min);
- delete num1, num2, num3, min, max;
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement