//max
#include <iostream>
using namespace std;
float(float a, float b, float c)
{
if (a>b)
}
//liniowamz
#include <iostream>
using namespace std;
float mz(float a, float b)
{
return (-b) / a;
}
int main()
{
cout << "Podaj a: ";
static float a;
cin >> a;
cin.get();
cout << "Podaj b: ";
static float b;
cin >> b;
cin.get();
float foo = mz(a, b);
cout << "Miejsce zerowe funkcji f(x)=" << a << "x+(" << b << ") to punkt: (" << foo << ", 0)" << endl;
cin.get();
return 0;
}
//delta
#include <iostream>
using namespace std;
struct mz
{
double x1;
double x2;
bool no_solution = 0;
};
mz obl_mz(double a, double b, double c)
{
mz result{};
double delta = ((b*b) - (4*a*c));
if (delta < 0)
{
result.no_solution = 1;
}
else if (delta > 0)
{
result.x1 = ((-b) - sqrt(delta)) / (2 * a);
result.x2 = ((-b) + sqrt(delta)) / (2 * a);
}
else
{
result.x1 = result.x2 = (-b) / (2 * a);
}
return result;
}
int main()
{
cout << "OBLICZANIE MIEJSC ZEROWYCH FUNKCJI KWADRATOWEJ" << endl;
cout << "----------------------------------------------" << endl;
cout << "Poda a: ";
double a;
cin >> a;
cin.get();
cout << "Poda b: ";
double b;
cin >> b;
cin.get();
cout << "Poda c: ";
double c;
cin >> c;
cin.get();
mz wynik = obl_mz(a, b, c);
if (wynik.no_solution == 1)
{
cout << "Brak miejsc zerowych w przestrzeni liczb rzeczywistych" << endl;
}
else if (abs(wynik.x1 - wynik.x2) < 0.000000000001)
{
cout << "x=" << wynik.x1;
}
else
{
cout << "x1=" << wynik.x1 << ", x2=" << wynik.x2 << endl;
}
cin.get();
return 0;
}
//fib
#include <iostream>
using namespace std;
unsigned long fib_r(const unsigned int n)
{
if (n < 1) return 0;
else if (n == 1 || n == 2) return 1;
else return (fib_r(n - 1) + fib_r(n - 2));
}
int main()
{
cout << "Ktory wyraz ciagu Fibonacciego obliczyc: ";
unsigned int n;
cin >> n;
cin.get();
cout << "#" << n << " wyraz to: " << fib_r(n) << endl;
cin.get();
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}