Advertisement
halexandru11

var 39 s3 ex3

Dec 3rd, 2020
58
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main() {
  8.     ifstream fin("date.in");
  9.     unsigned int n, x;
  10.     fin >> n;
  11.     int last = -1;
  12.     while(n--) {
  13.         fin >> x;
  14.         if(x%2 == 0) {
  15.             if((int)x >= last) {
  16.                 last = x;
  17.             }
  18.             else {
  19.                 cout << "NU";
  20.                 return 0;
  21.             }
  22.         }
  23.     }
  24.     cout << "DA";
  25. }
  26.  
Advertisement
RAW Paste Data Copied
Advertisement