Created
August 9, 2019 22:40
-
-
Save lazycipher/af12ddda772c1e50388af91ee1a9931a to your computer and use it in GitHub Desktop.
266A - Stones on the Table in C++
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<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