diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2020-12-31 12:19:01 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2020-12-31 12:19:01 +0100 |
commit | 7519114e55229bd5b2f4e55d5af8e0b813e5c2ee (patch) | |
tree | 9889f5ccf5b86b9ef6843e3d96dbd0532ecb9ad0 /c/las12uvas | |
parent | 3c8c6068d28a4cd3dc02cc2b55bd607109b133c5 (diff) | |
download | AceptaElReto-7519114e55229bd5b2f4e55d5af8e0b813e5c2ee.tar.gz AceptaElReto-7519114e55229bd5b2f4e55d5af8e0b813e5c2ee.zip |
Diffstat (limited to 'c/las12uvas')
-rw-r--r-- | c/las12uvas/2020/582_sonLosCuartos.cpp | 35 | ||||
-rw-r--r-- | c/las12uvas/2020/583_encuestaComprometedora.cpp | 28 | ||||
-rw-r--r-- | c/las12uvas/2020/584_duraciónDeBombillasLed.cpp | 27 |
3 files changed, 90 insertions, 0 deletions
diff --git a/c/las12uvas/2020/582_sonLosCuartos.cpp b/c/las12uvas/2020/582_sonLosCuartos.cpp new file mode 100644 index 0000000..47b7f0c --- /dev/null +++ b/c/las12uvas/2020/582_sonLosCuartos.cpp @@ -0,0 +1,35 @@ +#include <iostream> + +int main() { + + int casos; + std::string campanada; + std::string correcto; + + correcto = "doong"; + for (int i = 0; i < 11; i++) { + correcto += " doong"; + } + + std::cin >> casos; + std::getline(std::cin, campanada); + + while (casos > 0) { + std::getline(std::cin, campanada); + if (campanada == "") { + std::cout << "MARISA NARANJO\n"; + } + else if (campanada[1] == 'i' ) { + std::cout << "SALIDA NULA\n"; + } + else if (campanada == correcto) { + std::cout << "CORRECTO\n"; + } + else { + std::cout << "TARDE\n"; + } + casos--; + } + + return 0; +} diff --git a/c/las12uvas/2020/583_encuestaComprometedora.cpp b/c/las12uvas/2020/583_encuestaComprometedora.cpp new file mode 100644 index 0000000..6a46d4e --- /dev/null +++ b/c/las12uvas/2020/583_encuestaComprometedora.cpp @@ -0,0 +1,28 @@ +#include <iostream> + +int main() { + + int casos, comp, segunda; + int n; + int nReal; + int compReal; + int porcentaje; + + std::cin >> casos; + + while (casos > 0) { + std::cin >> comp; + std::cin >> segunda; + + n = comp + segunda; + nReal = n/2; + compReal = comp - nReal; + porcentaje = compReal * 100 / nReal; + + std::cout << porcentaje << '\n'; + + casos--; + } + + return 0; +} diff --git a/c/las12uvas/2020/584_duraciónDeBombillasLed.cpp b/c/las12uvas/2020/584_duraciónDeBombillasLed.cpp new file mode 100644 index 0000000..d4137d2 --- /dev/null +++ b/c/las12uvas/2020/584_duraciónDeBombillasLed.cpp @@ -0,0 +1,27 @@ +#include <iostream> + +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; +} |