Created
November 16, 2013 19:08
-
-
Save juliocc/7504003 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
static const int NUM_LETRAS = ('Z' - 'A') + 1; | |
int main(int argc, char const *argv[]){ | |
int arregloletras[NUM_LETRAS]; | |
int prev=0, current=0; | |
memset(arregloletras, 0, sizeof arregloletras); | |
while ( (current = getchar()) != EOF ){ | |
if (prev && (current == prev)) { | |
arregloletras[current-'A'] = 1; | |
} | |
prev = current; | |
} | |
for (int i=0; i < NUM_LETRAS; ++i) { | |
if ((arregloletras[i] == 0)){ | |
putchar(i+'A'); | |
} | |
} | |
putchar('\n'); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment