题意:读懂题后是一道超水超水的题。求分别以c 1开头,t 1开头的连续序列以及s的个数。代码如下,不知该怎么解释好了,最初错了易读错题意了。
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
int main()
{
int n;
while(~scanf("%d",&n))
{
int ans=0;
while(n--)
{
char c;
cin>>c;
if(c=='S')
{
ans++;
}
else
{
int t;
cin>>t;
if(t==1) ans++;
}
}cout<<ans<<endl;
}
}