MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / solve

Function solve

Codeforces_problems/Team/solution.cpp:5–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3using namespace std;
4
5bool solve(){
6 int arr[3];
7 int count = 0;
8 for(int i=0;i<3;i++){ // this loop takes the input and also check if the number given as input is 1 or 0
9 cin >> arr[i];
10 if(arr[i]==1){
11 count++; // increments the count if the number given as input if 1
12 }
13 }
14 if(count >=2){ // checks if 2 or more people are sure about the solution
15 return true; // returns true if 2 or more people are sure about the answer
16 }
17
18 return false; // else returns false
19}
20
21int main(){
22 ios::sync_with_stdio(0);

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected