NarekNavoyan

7-2

Nov 11th, 2021
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.31 KB | None | 0 0
  1. int.TryParse(Console.ReadLine(), out int n);
  2.  
  3. Random random = new Random();
  4.  
  5. int[] a = new int[n];
  6. for (int i = 0; i < n; i++)
  7. {
  8.     a[i] = random.Next(-100, 101);
  9.     Console.Write(a[i]+"\t");
  10. }
  11.  
  12. Console.WriteLine();
  13.  
  14. for (int i = 0; i < n; i++)
  15. {
  16.     a[i] = -a[i];
  17.     Console.Write(a[i]+"\t");
  18. }
Advertisement
Add Comment
Please, Sign In to add comment