aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2019-12-26 16:11:04 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2019-12-26 16:11:04 +0100
commitf139d0d9d1c4061909f5f36012cb9f7d0698cc9e (patch)
treee4a2a62dc6dc3f9f132af9a7f4c75356ca260e47 /c
parentc8327fe5cdfc8e31b8785aa169acd4939a07d25e (diff)
downloadAceptaElReto-f139d0d9d1c4061909f5f36012cb9f7d0698cc9e.tar.gz
AceptaElReto-f139d0d9d1c4061909f5f36012cb9f7d0698cc9e.zip
Resuelto 397 en c++: ¿Es múltiplo de 3?
Diffstat (limited to 'c')
-rw-r--r--c/397_múltiploDe3.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/c/397_múltiploDe3.cpp b/c/397_múltiploDe3.cpp
new file mode 100644
index 0000000..35e8129
--- /dev/null
+++ b/c/397_múltiploDe3.cpp
@@ -0,0 +1,12 @@
+#include <iostream>
+
+int main() {
+ int casos;
+ int caso;
+ std::string respuesta;
+ for (std::cin >> casos; casos > 0; casos--) {
+ std::cin >> caso;
+ (caso % 3 == 1) ? respuesta = "NO" : respuesta = "SI";
+ std::cout << respuesta << std::endl;
+ }
+}