Skip to content

Instantly share code, notes, and snippets.

@lazycipher
Created August 9, 2019 22:40
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 lazycipher/af12ddda772c1e50388af91ee1a9931a to your computer and use it in GitHub Desktop.
Save lazycipher/af12ddda772c1e50388af91ee1a9931a to your computer and use it in GitHub Desktop.
266A - Stones on the Table in C++
#include<iostream>
int main(){
int stones_count, count=0;
std::string stones;
std::cin>>stones_count;
std::cin>>stones;
for(int i=1; i<stones_count;i++){
if(stones[i] == stones[i-1]){
count++;
}
}
std::cout<<count;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment