Skip to content

Instantly share code, notes, and snippets.

@tungaqhd
Created July 17, 2019 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tungaqhd/be86f686c3c86d43c498e35f55c30966 to your computer and use it in GitHub Desktop.
Save tungaqhd/be86f686c3c86d43c498e35f55c30966 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
void sosanh(int a[]);
int main()
{
int n, i;
cin>>n;
int a[n][4];
for (i=0; i<n; i++)
for(int j=0; j< 4; j++)
cin>>a[i][j];
for(i=0; i<n; i++)
{
sosanh(a[i]);
}
}
void sosanh(int a[4])
{
for (int i=0; i<4; i++)
if(a[i]==2)
{
for (int j=0; j<4; j++)
if(a[j]==0)
{
for (int m=0; m<4; m++)
if(a[m]==1)
{
for (int k=0; k<4; k++)
if(a[k]==9)
{
cout<<"PIG PIG PIG\n";
return ;
}
}
}
}
else
{
cout<<"NO NO NO\n";
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment