diff options
Diffstat (limited to 'c/las12uvas/2019/587_laTiaManuela.cpp')
-rw-r--r-- | c/las12uvas/2019/587_laTiaManuela.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/c/las12uvas/2019/587_laTiaManuela.cpp b/c/las12uvas/2019/587_laTiaManuela.cpp new file mode 100644 index 0000000..092dc3d --- /dev/null +++ b/c/las12uvas/2019/587_laTiaManuela.cpp @@ -0,0 +1,38 @@ +#include <iostream> +#include <vector> +#include <algorithm> + +int cabe(std::vector<int> j, std::vector<int> c) { + for (int i = 0; i < 3; i++) { + if (j[i] >= c[i]) { + return 0; + } + } + return 1; +} + +int main() { + int casos; + std::vector<int> juguete; + std::vector<int> caja; + int n; + std::string salida; + std::cin >> casos; + for (int i = 0; i < casos; i++) { + juguete.clear(); + caja.clear(); + for (int j = 0; j < 3; j++) { + std::cin >> n; + juguete.push_back(n); + } + for (int j = 0; j < 3; j++) { + std::cin >> n; + caja.push_back(n); + } + std::sort(juguete.begin(), juguete.end()); + std::sort(caja.begin(), caja.end()); + salida = cabe(juguete, caja) ? "SIRVE" : "NO SIRVE"; + std::cout << salida << std::endl; + } +} + |