LinuxTour's blog

By LinuxTour, history, 3 years ago, In English
#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;
}

`

Full text and comments »

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