Advertisement
vitormartinotti

Colchão com ordenação

Mar 27th, 2025
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. int main() {
  3.     int a, b, c, l, h, aux;
  4.     scanf(" %d %d %d %d %d", &a, &b, &c, &h, &l);
  5.     if(a > b){
  6.         aux = a;
  7.         a = b;
  8.         b = aux;
  9.     }
  10.     if(a > c){
  11.         aux = a;
  12.         a = c;
  13.         c= aux;
  14.     }
  15.     if(b > c){
  16.         aux = b;
  17.         b = c;
  18.         c = aux;
  19.     }
  20.     if(l > h){
  21.         aux = l;
  22.         l = h;
  23.         h = aux;
  24.     }
  25.     if(a < l && b < h){
  26.         printf("S");
  27.     }
  28.     else{
  29.         printf("N");
  30.     }
  31.     return 0;
  32. }
  33.  
  34.  
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement