Alx09

Untitled

Apr 9th, 2019
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. bool f(int n)
  5. {
  6. static int x = 0;
  7.  
  8. int a;
  9. cin >> a;
  10. if(n == 1 )cin >> x;
  11. else return f(n-1);
  12. if(x == a)return true;
  13. else return false;
  14.  
  15.  
  16.  
  17.  
  18.  
  19. }
  20.  
  21. int main()
  22. {
  23. int n; cin >> n;
  24. if(f(n)) cout <<"Da";
  25. else cout <<"NU";
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment