Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2020
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main(){
  6.    int a, b, c, medio;
  7.    cout << "Ingrese tres numeros: ";
  8.    cin >> a >> b >> c;
  9.    if (a>b && b>c) {
  10.     medio=b;
  11.    }
  12.    else {
  13.     if (a>b) {
  14.         if (a>c) {
  15.             medio=c;
  16.         }
  17.         else {
  18.             medio=a;
  19.         }
  20.     }
  21.     else {
  22.         if (b>c) {
  23.             if (a>c) {
  24.                 medio=a;
  25.             }
  26.             else {
  27.                 medio=c;
  28.             }
  29.         }
  30.         else {
  31.             medio=b;
  32.         }
  33.     }
  34.    }
  35.    cout << "El numero del medio es: " << medio;
  36.  
  37.  
  38.  
  39.    return 0;
  40.  
  41.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement