From 7519114e55229bd5b2f4e55d5af8e0b813e5c2ee Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Thu, 31 Dec 2020 12:19:01 +0100 Subject: =?UTF-8?q?A=C3=B1adidas=20soluciones=20de=20algunos=20problemas?= =?UTF-8?q?=20de=20Las=20Doce=20Uvas=20de=202020.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2020/584_duraci\303\263nDeBombillasLed.cpp" | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 "c/las12uvas/2020/584_duraci\303\263nDeBombillasLed.cpp" (limited to 'c/las12uvas/2020/584_duraciónDeBombillasLed.cpp') diff --git "a/c/las12uvas/2020/584_duraci\303\263nDeBombillasLed.cpp" "b/c/las12uvas/2020/584_duraci\303\263nDeBombillasLed.cpp" new file mode 100644 index 0000000..d4137d2 --- /dev/null +++ "b/c/las12uvas/2020/584_duraci\303\263nDeBombillasLed.cpp" @@ -0,0 +1,27 @@ +#include + +int main() { + + int casos, horas, encendidos, horasUso; + std::string causa = ""; + + std::cin >> casos; + + while (casos > 0) { + std::cin >> horas; + std::cin >> encendidos; + std::cin >> horasUso; + + if (horasUso * encendidos > horas) + causa = "HORAS"; + else if (horasUso * encendidos < horas) + causa = "ENCENDIDOS"; + else + causa = "AMBAS"; + + std::cout << causa << '\n'; + casos--; + } + + return 0; +} -- cgit v1.2.1