GVA SUPPORT

Відповідь на запитання № 1296035483
Text:
	ФІО = Руденко Віктор

 Запитання: Запитання:знайти максимальне значення y=x*cos(2sin(x)) на проміжку [0.1] тільки не через for  через while або do-while 


====================================


 ANSWER ====================================

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication5
{
    class Program
    {
        static double f(double x)
        {
            return x * Math.Cos(2 * Math.Sin(x));
        }
        static void Main(string[] args)
        {

            double tochnost = 0.0001;
            double a = 0, b = 1;

            double max = f(a);
  
            double i = a;
            while (i <= b)
            {
                if (max < f(i)) max = i + f(i);
                i += tochnost;
            }
            Console.WriteLine("Max = {0}", max);
            Console.ReadKey();
        }
    }
}


 END of ANSWER ====================================

	
Ваша відповідь