地址:http://codeforces.com/contest/266/problem/A
可以看作是记录连续重复序列的长度和
1 #include<stdio.h> 2 3 int n; 4 char in[55]; 5 6 int main() 7 { 8 int i,count=0; 9 scanf("%d",&n); 10 scanf("%s",in); 11 for(i=0;i<n-1;i++) 12 { 13 if(in[i]==in[i+1]) 14 { 15 count++; 16 } 17 } 18 printf("%d\n",count); 19 return 0; 20 }