Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <stdbool.h>
  3. #include <stdio.h>
  4. #include <math.h>
  5. #include <string.h>
  6. #include <ctype.h>
  7.  
  8. void main()
  9. {
  10. int n, a[150];
  11. bool x = false;
  12. scanf("%d", &n);
  13. for (int i = 0; i < n; i++)
  14. {
  15. scanf("%d", &a[i]);
  16. }
  17. for (int i = 0; i < n; i++)
  18. {
  19. for (int j = 0; j < n; j++)
  20. {
  21. if (a[i] == a[j] && j != i)
  22. x = true;
  23. }
  24. }
  25. x ? printf("NO") : printf("YES");
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement