Skip to content

Instantly share code, notes, and snippets.

@joaogui1
Created April 3, 2016 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joaogui1/dea20ee366c621a99f20d4fd45bf21d7 to your computer and use it in GitHub Desktop.
Save joaogui1/dea20ee366c621a99f20d4fd45bf21d7 to your computer and use it in GitHub Desktop.
#include <cstdio>
using namespace std;
int main() {
char ant, S[35];
int n;
scanf("%d", &n);
while(n--) {
ant = 'A';
scanf(" %[^\n]", S);
for(int i = 0; S[i] != '\0'; i++) {
if(S[i] != ant) {
printf("%c", S[i]);
ant = S[i];
}
}
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment