Skip to content

Instantly share code, notes, and snippets.

@MohamedTaha98
Last active June 21, 2017 15:36
Show Gist options
  • Save MohamedTaha98/7246954afffe8eb4ae7c2a75ae354d54 to your computer and use it in GitHub Desktop.
Save MohamedTaha98/7246954afffe8eb4ae7c2a75ae354d54 to your computer and use it in GitHub Desktop.
Problem Solving
#include <iostream>
using namespace std;
int main() {
int n, solved = 0, sures;
cin >> n;
int ar[3];
for (int probs = 0; probs < n; probs++) {
sures = 0;
for (int i = 0; i < 3; i++) {
cin >> ar[i];
if (ar[i] == 1)
sures++;
}
if (sures >= 2)
solved++;
}
cout << solved;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment