Created
July 17, 2019 08:26
-
-
Save tungaqhd/be86f686c3c86d43c498e35f55c30966 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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