Advertisement
ajreuri23

שאלה 19

Dec 3rd, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3. double[] a = new double[10];
  4. double[] b = new double[a.Length];
  5. int i, j, x, f;
  6. for (i = 0; i < a.Length; i++)
  7. {
  8. a[i] = double.Parse(Console.ReadLine());
  9. }
  10. for (j = 0; j < a.Length; j++)
  11. {
  12. if (j % 2 == 0)
  13. {
  14. b[j] = Math.Pow(a[j], 2);
  15. }
  16. else
  17. {
  18. b[j] = Math.Sqrt(a[j]);
  19. }
  20. }
  21. Console.WriteLine("");
  22. for (x = 0; x < a.Length; x++)
  23. {
  24. Console.Write(a[x] + " ");
  25. }
  26. Console.WriteLine("");
  27. for (f = 0; f < a.Length; f++)
  28. {
  29. Console.Write(b[f] + " ");
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement