М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации
smolich
smolich
26.05.2020 01:33 •  Информатика

Получить таблицу значений функции y = 5 ^ x-8lnx для всех значений х [0.5; 2.5] с шагом h = 0.25

👇
Открыть все ответы
Ответ:
daysannas
daysannas
26.05.2020
Вот на С++:

#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <cstring>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <climits>typedef unsigned long long ulol;
typedef long double ld;
typedef long long lol;
typedef long int  li;#define mp          make_pair
#define F           first
#define S           second
#define sqr(a)      ( (a) * (a) )
#define pb          push_back
#define INF         999999999
#define ret(a)      cout << endl; system("pause"); return(a)
//#define ret(a)      return(a)using namespace std;int main()
{
    ld x;
    cin >> x;
    x = ( 8 / sqrt( x ) ) + sqrt(x);
    cout << x;
    ret(0);
}
4,7(85 оценок)
Ответ:
JukovaEleonora
JukovaEleonora
26.05.2020
Ну, в общем, лови решение.

{ FreePascal 2.6.4}
program test;
uses
    crt;
var
    a, b, c, d  : integer;
    f : longint;

procedure swap (var x : integer; var y : integer);
var z : integer;
begin
    z := x;
    x := y;
    y := z;
end;

function nod (m, n : integer) : integer;
begin
    while m<>n do begin
        if m>n
        then
            m:=m-n
        else
            n:=n-m;
    end;
    nod := m;
end;

function max (a,b : integer) : integer;
begin
    if a>b
    then max := a
    else max := b;
end;

function min (x, y, z : integer) : integer;
var m : integer;
begin
    m := x;
    if y<m then m := y;
    if z<m then m := z;
    min := m;
end;

function mypow (a, b : integer) : integer;
var e, f : integer;
begin
    f := 1;
    for e:=1 to b do f := f*a;
    mypow := f;
end;

function fact(a : integer) : longint;
var
    i : integer;
    res : longint;
begin
    res := 1;
    for i := 1 to a do res := res*i;
    fact := res;
end;

begin
    clrscr;
    writeln('Test of function SWAP');
    write('Input A: ');
    readln(a);
    write('Input B: ');
    readln(b);
    swap(a, b);
    writeln('A=', a, ', B=', b);
    writeln;

    writeln('Test of function NOD');
    write('Input A: ');
    readln(a);
    write('Input B: ');
    readln(b);
    c := nod(a, b);
    writeln('NOD(', a, ',', b, ')=', c);
    writeln;

    writeln('Test of function MAX');
    write('Input A: ');
    readln(a);
    write('Input B: ');
    readln(b);
    c := max(a, b);
    writeln('MAX(', a, ',', b, ')=', c);
    writeln;

    writeln('Test of function MIN');
    write('Input A: ');
    readln(a);
    write('Input B: ');
    readln(b);
    write('Input C: ');
    readln(c);
    d := min(a, b, c);
    writeln('MIN(', a, ',', b, ',', c, ')=', d);
    writeln;

    writeln('Test of function POW');
    write('Input A: ');
    readln(a);
    write('Input B: ');
    readln(b);
    c := mypow(a, b);
    writeln('POW(', a, ',', b, ')=', c);
    writeln;

    writeln ('Test of function FACT (not large than 12!)');
    write('Input A: ');
    readln(a);
    f := fact(a);
    writeln(a, '!=', f);
    writeln;
    readkey;

end.
4,6(4 оценок)
Новые ответы от MOGZ: Информатика
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ