initial commit
This commit is contained in:
parent
dcd7dbed7e
commit
304eb3ced5
28
266A Stones on the Table/266A.cpp
Normal file
28
266A Stones on the Table/266A.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
using ll = long long;
|
||||
|
||||
void solve()
|
||||
{
|
||||
int n;
|
||||
cin>>n;
|
||||
string s;
|
||||
cin>>s;
|
||||
int ct=0;
|
||||
for(int i=0; i<n-1; ++i)
|
||||
{
|
||||
if(s[i]==s[i+1]) ct++;
|
||||
}
|
||||
cout<<ct<<endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
ios_base::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int TC = 1;
|
||||
//cin >> TC;
|
||||
//cin.ignore();
|
||||
while (TC--) solve();
|
||||
}
|
Loading…
Reference in New Issue
Block a user