Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,v[101],i,ant,g=0,ok=1;
- cin>>n;
- for (i=1;i<=n;i++)
- cin >> v[i];
- for (i=1;i<=n;i++)
- {
- if (v[i]%2==0)
- {
- if (g==0)
- {
- ant=v[i];
- g=1;
- }
- else
- {
- if (v[i]<ant)
- {
- ok=0;
- break;
- }
- }
- ant=v[i];
- }
- }
- if (ok)
- cout << "DA";
- else
- cout << "NU";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement