Skip to content

Commit cf93b41

Browse files
committed
Stones on the Table
1 parent 08586dd commit cf93b41

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

266A.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include<iostream>
2+
#include<string>
3+
using namespace std;
4+
5+
int main(){
6+
int n, count = 0;
7+
cin>>n;
8+
string s;
9+
cin>>s;
10+
for(int i = 0; i < n-1; i++){
11+
if(s[i] == s[i+1]){
12+
count++;
13+
}
14+
}
15+
cout<<count;
16+
return 0;
17+
}

0 commit comments

Comments
 (0)