A. Team
Problem Link: [Codeforces 231A##link##]
- [tab]
- C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int a,b,c; int s=0; for (int i=0;i<n;i++){ cin >> a >> b >> c; if (a+b+c>=2){ s += 1;} } cout << s; }
- Python 3
n = int(input()) cou = 0 for i in range(n): a, b, c = map(int, input().split(' ')) if a + b + c >= 2: cou += 1 print(cou)
- JAVA
//java8 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int c = 0; for(int i=0; i<n; i++){ int sum = 0; int x = sc.nextInt(); int y = sc.nextInt(); int z = sc.nextInt(); sum += x+y+z; if(sum>1){ c += 1; } } System.out.println(c); } }