Text: |
ФІО = новиков влад
Запитання:Розрахувати мынымальне значення функцыы y=sin(2sin(x))/x на промыжку [3,5]
====================================
ANSWER ====================================
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication8
{
class Program
{
static void Main(string[] args)
{
double y,x,tochnost=0.1;
for (x = 3; x <= 5 + tochnost; x += tochnost)
{
y=Math.Sin(2*Math.Sin(x))/x;
Console.WriteLine("f({0}) = {1}",x,y);
}
Console.ReadKey();
}
}
}
END of ANSWER ====================================
ANSWER ====================================
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication19
{
class Program
{
static void Main(string[] args)
{
double y, x=3, tochnost = 0.1;
double miny = Math.Sin(2 * Math.Sin(2 * Math.Sin(x))) / x;
double minx = x;
for (x = 3; x <= 5 + tochnost; x += tochnost)
{
y = Math.Sin(2 * Math.Sin(2 * Math.Sin(x))) / x;
if (y < miny)
{
miny = y; minx = x;
}
}
Console.WriteLine("min f({0}) = {1}", minx, miny);
Console.ReadKey();
}
}
}
END of ANSWER ====================================
|