UVA 12798 – Handball Solution

My code:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j;
    while(scanf("%d %d",&n,&m)==2)
    {
        int cnt=0;
        for(i=0; i<n; i++)
        {
            bool goal_missed=false;
            int val=0;
            for(j=0; j<m; j++)
            {
                cin>>val;
                if(!val)
                {
                    goal_missed=true;
                }
            }
            if(!goal_missed)
            {
                cnt++;
            }
        }
        cout<<cnt<<endl;
    }
    return 0;
}

 

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *