Advertisement
Guest User

vtora zadacha

a guest
Jan 19th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace ConsoleApp1
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. Console.WriteLine("Vuvedi golemina na array:");
  12. int n = Convert.ToInt32(Console.ReadLine());
  13. double[] arr = new double[n];
  14. for (int i = 0; i < n; i++)
  15. {
  16. Console.WriteLine("Vuvedi chislo:");
  17. arr[i] = Convert.ToDouble(Console.ReadLine());
  18. }
  19.  
  20. Console.WriteLine("Chisla na cheten index:");
  21. for (int i = 0; i < arr.Length; i++)
  22. {
  23. if (i % 2 == 0)
  24. {
  25. Console.WriteLine(arr[i]);
  26. }
  27. }
  28. }
  29.  
  30.  
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement