Блог пользователя wick3d

Автор wick3d, история, 3 года назад, По-английски

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; }

Полный текст и комментарии »

  • Проголосовать: нравится
  • -15
  • Проголосовать: не нравится