I am getting error 'the solution is executed with error 'uninitialized value usage'', My output is correct but it is not accepting my code and giving this error in Problem round #243 Div 2

Revision en1, by LinuxTour, 2021-04-19 15:36:52
#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;
}

`

Tags round #143, uninitiaized value usage, #error, #codeforces

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English LinuxTour 2021-04-19 15:36:52 638 Initial revision (published)