Skip to content

Instantly share code, notes, and snippets.

@augusteo
Created November 14, 2014 06:40
Show Gist options
  • Save augusteo/010886da41575330ed26 to your computer and use it in GitHub Desktop.
Save augusteo/010886da41575330ed26 to your computer and use it in GitHub Desktop.
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int number, result, i;
string text;
int main() {
scanf("%i", &number);
while(number--){
scanf("%s", &text);
result = 0;
for(i=0;i<text.length() -1;i++){
if (text[i] == text[i+1]){
result++;
}
}
printf("%i\n", result);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment