Advertisement
Guest User

lecki 5.1

a guest
Oct 10th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 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 Func() //дополнительный метод
  12. {
  13. Console.Write("x= ");
  14. double x = double.Parse(Console.ReadLine());
  15. double y = 1 / x;
  16. Console.WriteLine("y({0})={1}", x, y);
  17. }
  18.  
  19. static void Main() //точка входа в программу
  20. {
  21. int n = int.Parse(Console.ReadLine());
  22. for (int i = 0; i < n; i++)
  23. { Func();
  24. Func();
  25. Func();
  26. }
  27. }
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement