您的位置:首页 > 其它

CodeForces 231 A.Team(水~)

2017-09-01 23:20 399 查看
Description

给出三个人做n道题的结果,0表示错1表示对,只要有两个人做对就算做对,问做对了几题

Input

第一行一整数n表示题数,之后n行每行三个01值表示三个人做这道题的结果(1≤n≤1000)

Output

输出做对的题数

Sample Input

3

1 1 0

1 1 1

1 0 0

Sample Output

2

Solution

水题

Code

#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<ctime>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
const int INF=0x3f3f3f3f,maxn=100001;
char a[maxn][3];
int n;
int main()
{
while(~scanf("%d",&n))
{
for(int i=0;i<n;i++)
for(int j=0;j<3;j++)
scanf("%d",&a[i][j]);
int ans=0;
for(int i=0;i<n;i++)
if(a[i][0]+a[i][1]+a[i][2]>=2)ans++;
printf("%d\n",ans);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: