Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. bool temp (int N, int a[]);
  7.  
  8. int main ()
  9. {
  10. ifstream duom("duom.txt");
  11. ofstream rez("rez.txt");
  12. int N, a[3];
  13. cin>>N;
  14. for (int i=0;i<3;i++)
  15. cin>>a[i];
  16. if (temp(N,a))
  17. cout<<"LYGINIS";
  18. else
  19. cout<<"NELYGINIS";
  20. return 0;
  21. }
  22. bool temp (int N, int a[])
  23. {
  24. int x=0;
  25. for (int i=0; i<3 ;i++)
  26.  
  27. {
  28. if (a[i]% 2!=0)
  29. x++;
  30. if (x>1)
  31. return 1;
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement