2014-11-01 01:44:27

总结:前三题是技巧,D题是博弈。

A:简单模拟

 1 /*************************************************************************
 2     > File Name: a.cpp
 3     > Author: Nature
 4     > Mail: 564374850@qq.com 
 5     > Created Time: Fri 31 Oct 2014 10:20:48 PM CST
 6 ************************************************************************/
 7 
 8 #include <cstdio>
 9 #include <cstring>
10 #include <cstdlib>
11 #include <cmath>
12 #include <vector>
13 #include <map>
14 #include <set>
15 #include <stack>
16 #include <queue>
17 #include <iostream>
18 #include <algorithm>
19 using namespace std;
20 #define lp (p << 1)
21 #define rp (p << 1|1)
22 #define getmid(l,r) (l + (r - l) / 2)
23 #define MP(a,b) make_pair(a,b)
24 typedef long long ll;
25 const int INF = 1 << 30;
26 
27 int n;
28 char s[10];
29 
30 int main(){
31     int x = 0,flag;
32     scanf("%d",&n);
33     for(int i = 1; i <= n; ++i){
34         scanf("%s",s);
35         for(int i = 0; i < 3; ++i){
36             if(s[i] == '+') flag = 1;
37             if(s[i] == '-') flag = -1;
38         }
39         x += flag;
40     }
41     printf("%d\n",x);
42     return 0;
43 }
View Code

相关文章:

  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
相关资源
相似解决方案