提交时间:2022-08-03 17:03:54

运行 ID: 56936

#include<bits/stdc++.h> using namespace std; int ans; char front='1'; int n; int main(){ cin>>n; while(n--){ char a; cin>>a; if(front!=a) ans++,front=ans; } cout<<++ans; return 0; }