aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
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 != '.');
+}