partners
?>

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

Информатика

Ответы

Sacharov84
Вот на С++:

#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);
}
Воздвиженская
Ну, в общем, лови решение.

{ 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.

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

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

Популярные вопросы в разделе

ValeriyaAleksandr
morsh9345
Голосова-Лобанов1555
Reginahappy
Галина-Юлия1292
ddobrov32133
Шуршилина_Ильич
libirishka7910
Irina-Tunyan
nalich8524
boyarinovigor
inainainainaina0073
slava-m-apt
armusaeff
antonkovalev89