Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp2
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = 9;
  14. Random rand = new Random();
  15. int[,] arr = new int[n, n];
  16. for (int i = 0; i < n; i++)
  17. {
  18. for (int j = 0; j < n; j++)
  19. {
  20. arr[i, j] = rand.Next(50);
  21. }
  22. }
  23. for (int i = 0; i < n - 1; i++)
  24. {
  25. if (arr[1, i] % 3 == 0)
  26. Console.WriteLine(arr[1, i]);
  27. }
  28. for (int j = 0; j < n - 1; j++)
  29. {
  30. if (arr[1, j] % 3 == 0)
  31. Console.WriteLine(arr[1, j]);
  32. }
  33. Console.ReadKey();
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement