#include<iostream>
using namespace std;
int main()
{
int n, mod, result;
int a[3];
cin>>n;
for(int i=0;i<n;i++)
{
for(int c=0;c<3;c++)
{
cin>>a[c];
}
for(int j=0;j<3;j++)
{
if(a[j] == 1)
{
mod = mod + 1;
}
}
if(mod == 2 || mod == 3)
{
result = result + 1;
mod = 0;
}
else
{
mod = 0;
}
}
cout<<result;
return 0;
}
`
Your code is basically incrementing a non-initialized 'result' variable (so it may contain any random garbage at start) and printing it as the output. The 'mod' variable is also suspicious.
mod = 0, result = 0?
at first "mod" and "result" do not have values, and then you can 1 to mod, but mod doesn't have value. maybe you should write mod = 0; and result = 0;
also i think that your solution is not correct anyway