diff options
Diffstat (limited to 'codeforces/StonesOnTheTable/main.cpp')
| -rw-r--r-- | codeforces/StonesOnTheTable/main.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/codeforces/StonesOnTheTable/main.cpp b/codeforces/StonesOnTheTable/main.cpp new file mode 100644 index 0000000..a9903c9 --- /dev/null +++ b/codeforces/StonesOnTheTable/main.cpp @@ -0,0 +1,19 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int n; + cin >> n; + string s; + cin >> s; + int count = 0; + for(int i = 0; i < s.size() - 1;i++) { + if(s[i] == s[i + 1]) { + count++; + } + } + cout << count << endl; +} |
