Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- //#include <fstream>
- using namespace std;
- //ifstream fin("pozitie.in");
- //ofstream fout("pozitie.out");
- int main()
- {
- int n;
- cin >> n;
- int x[101], adv = 0;
- for(int i = 1;i <= n;i ++)
- cin >> x[i];
- for(int i = 2;i < n && adv == 0;i ++)
- if((x[i - 1] % 2 == 0 && x[i] % 2 == 0 && x[i + 1] % 2 == 0) || (x[i - 1] % 2 == 1 && x[i] % 2 == 1 && x[i + 1] % 2 == 1))
- adv = 1;
- if(adv)
- cout << "DA";
- else
- cout << "NU";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement