Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace prac_3_ex_5
- {
- class Program
- {
- static double Fun(double x, double a)
- {
- if (x < a) return 0;
- else
- if (x == a) return 1;
- else
- return (x - a) / (x + a);
- }
- static void Main(string[] args)
- {
- Console.WriteLine("Введите a, b и h: ");
- double a = double.Parse(Console.ReadLine());
- double b = double.Parse(Console.ReadLine());
- double h = double.Parse(Console.ReadLine());
- for (double i = a; i <= b; i += h)
- Console.WriteLine("x = {0,5} \t y = {1}", i, Fun(i, a));
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement