```cpp
int a[100],ans ; int main() { int n , t = 0 ; while (scanf("%d",&n)!=EOF) { for (int i=1; i<=n; ++i) scanf("%d",a+i); ans = 0 ; for (int i=1; i<=n ; ++i) if (a[i]!=a[i-1]) ++ans ; ans = ans /3 + ( ans % 3>0) ; ++t ; printf("Case %d: %d\n",t,ans) ; } } ```
原文地址:http://www.cnblogs.com/lijianlin1995/p/3836525.html