提交时间:2022-08-03 17:19:41
运行 ID: 56973
#include <bits/stdc++.h> using namespace std; int n,counter; char a[114514],oi,no; int main(){ cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; if(a[i]!=oi) counter++,oi=a[i]; } cout<<counter++; return 0; }