| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 56824 | 吴乐涵 | 排队买票 | C++ | Accepted | 100 | 0 MS | 248 KB | 233 | 2022-08-03 15:01:28 |
#include<bits/stdc++.h> using namespace std; int n,z,ans=1; char fw[30]; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>fw[i]; if(fw[i-1]==fw[i]||fw[i+1]==fw[i]) continue; else ans++; } cout<<ans; return 0; }