When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

wick3d's blog

By wick3d, history, 3 years ago, In English

Here is the test case:99822971

99822971

include

using namespace std; struct team{ int p1,p2,p3; }; //there are 3 people int main() { int n,sum=0,problems=0; //input the number of problems cin>>n;

if(n>=1 && n<=100){
struct team *p=nullptr;
//create an array of n problems
p=new team[n];
for(int i=0;i<n;i++){
    cin>>p[i].p1;
    cin>>p[i].p2;
    cin>>p[i].p3;
}
for(int i=0;i<n;i++){
    sum=p[i].p1+p[i].p2+p[i].p3;
    if(sum>=2)
        {
            problems++;
        }
}
cout<<problems;
free(p);

} return 0; }

  • Vote: I like it
  • -15
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

It means there are more lines that are not shown.