• Вопрос по информатике:

    Постройте таблицу значений функции y = f(x) для x€[a, b] с шагом h НА С#

    • Автор:

      prince32
  • using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;   namespace ConsoleApplication6 {     class Program     {         static void Main(string[] args)         {             Console.Write("a= ");             double a = double.Parse(Console.ReadLine());             Console.Write("b= ");             double b = double.Parse(Console.ReadLine());             Console.Write("h= ");             double h = double.Parse(Console.ReadLine());             double y = 0;             int i = 1;             Console.WriteLine("{0,3} {1,5} {1,5}", "#", "x", "f(x)"); for (double x = a; x <= b; x += h, ++i)             {                   if (x >= 0.9)                 {                       y = 1/(Math.Pow(0.1+x,2));                                     }                   else                 {                       if (x < 0.9)                     {                           y = 0.2*x+0.1;                       }                       else                     {                         if(x<0)                     {                           y = Math.Pow(x,2)+0.2;                       }                         }                   }                   Console.WriteLine("{0,3} {1,5:f2} {2,5:f2}", i, x, y);             }             Console.ReadKey();         }     } }

    • Отвечал:

      chayahendricks

    Ответов нет, но ты это испарвиш!