aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2019-05-29 16:52:29 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2019-05-29 16:52:29 +0200
commit990d4fc5d0945f8d78fdcc8cea6edd1dc3c38446 (patch)
treeba0f77e62e3131e3d36ae629bc8442748754821a /c
parentd7bb1dabe20d1406585264ad4608914c968f48a5 (diff)
downloadAceptaElReto-990d4fc5d0945f8d78fdcc8cea6edd1dc3c38446.tar.gz
AceptaElReto-990d4fc5d0945f8d78fdcc8cea6edd1dc3c38446.zip
Resuelto 482 en c++: Los calcetines de Ian Malcolm.
Diffstat (limited to 'c')
-rw-r--r--c/las12uvas/482_losCalcetinesDeIanMalcolm.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/c/las12uvas/482_losCalcetinesDeIanMalcolm.cpp b/c/las12uvas/482_losCalcetinesDeIanMalcolm.cpp
new file mode 100644
index 0000000..9d3e8a5
--- /dev/null
+++ b/c/las12uvas/482_losCalcetinesDeIanMalcolm.cpp
@@ -0,0 +1,30 @@
+#include <iostream>
+
+using namespace std;
+
+int main() {
+ char i;
+ char black, grey;
+ cin >> i;
+ if ( i != '.' )
+ do {
+ black = 0;
+ grey = 0;
+ while (i != '.') {
+ if ( i == 'N' )
+ black = (black+1)%2;
+ if ( i == 'G' )
+ grey = (grey+1)%2;
+ cin >> i;
+ }
+ if (black && grey)
+ cout << "PAREJA MIXTA\n";
+ else if (black)
+ cout << "NEGRO SOLITARIO\n";
+ else if (grey)
+ cout << "GRIS SOLITARIO\n";
+ else
+ cout << "EMPAREJADOS\n";
+ cin >> i;
+ } while (i != '.');
+}