Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
56959 周景轩 排队买票 C++ Accepted 100 0 MS 248 KB 220 2022-08-03 17:13:02

Tests(9/9):


#include<bits/stdc++.h> using namespace std; int n,ans=2; char c,fc; int main(){ cin>>n; cin>>fc; for(int i=2;i<=n;i++){ cin>>c; if(c==fc) continue; else fc=c; ans++; } cout<<ans; return 0; }


Judgement Protocol: