题目链接:http://hihocoder.com/problemset/problem/1258

题目大意:看能连击的次数

思路:水 看有多少个1和s就好了

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <iostream>
 4 using namespace std;
 5 char str[10];
 6 const int maxn=10000;
 7 int main(){
 8     int n;
 9     //freopen("C:\\Users\\acm\\Desktop\\2015Beijing\\in.txt","r",stdin);
10     while(scanf("%d",&n)!=EOF){
11         int cnt=0,x;
12         for(int i=1;i<=n;i++){
13             scanf("%s",str);
14             if(str[0]=='S') cnt++;
15             else {
16                 scanf("%d",&x);
17                 if(x==1) cnt++;
18             }
19         }
20         printf("%d\n",cnt);
21     }
22     return 0;
23 }

 

相关文章:

  • 2021-09-11
  • 2021-10-16
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-25
  • 2022-12-23
  • 2021-10-05
  • 2021-05-28
  • 2021-07-06
  • 2021-06-03
  • 2021-07-20
相关资源
相似解决方案