Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("date.in");
- int main()
- {
- int x,p1=-1,p2=-1,i1=-1,i2=-1,ok=1;
- while(fin>>x){
- if(x%2==0){
- if(p1==-1){
- p1=x;
- p2=x;
- }
- else{
- p1=p2;
- p2=x;
- if(p1<=p2)
- {
- ok=0;
- }
- }
- }
- else
- {
- if(i1==-1)
- {
- i1=x;
- i2=x;
- }
- else
- {
- i1=i2;
- i2=x;
- if(i1>=i2)
- {
- ok=0;
- }
- }
- }
- }
- /// (ok==1)? cout<<"DA": cout<<"NU";
- if(ok==1){
- cout<<"DA";
- }
- else
- {
- cout<<"NU";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement