Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using static System.Console;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace КР6_2
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. Write("Введите размерность массива: "); int n = int.Parse(ReadLine());
  15. Write("Введите число: "); int a = int.Parse(ReadLine());
  16. int[] X = new int[n];
  17. Random rnd = new Random();
  18. for (int i = 0; i < X.Length; i++)
  19. {
  20. X[i] = rnd.Next(5, 35);
  21. WriteLine("X({0}) = {1}", i, X[i]);
  22. }
  23. for (int i = 0; i < X.Length; i++)
  24. {
  25. if (X[i] > a)
  26. {
  27. WriteLine("Число с индексом {0} больше заданного.", i);
  28. }
  29. }
  30. ReadKey();
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement