Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main()
  6. {
  7. int n = int.Parse(Console.ReadLine());
  8.  
  9. int[] array = new int[n];
  10.  
  11. for (int i = 0; i<n;i++) {
  12. array[i]=int.Parse(Console.ReadLine());
  13. }
  14.  
  15. bool numbersAreDifferent = true;
  16.  
  17. for (int i = 0; i<n;i++) {
  18. for (int j = i+1;j<n;j++) {
  19. if (array[i]==array[j]) {
  20. numbersAreDifferent = false;
  21. }
  22. }
  23. }
  24.  
  25. Console.WriteLine(numbersAreDifferent);
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement