From c0c5842cd8dfc9a5997e1e229cf69b0327f03086 Mon Sep 17 00:00:00 2001 From: VectorKappa Date: Wed, 12 Oct 2022 17:14:28 +0200 Subject: [PATCH] =?UTF-8?q?Dodano=20zadania=20z=20drugich=20zaj=C4=99?= =?UTF-8?q?=C4=87=20laboratorium.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Laboratorium/20221012161651/kwadratowe.cpp | 10 ++++++++++ Laboratorium/20221012161651/liniowe.cpp | 7 +++++++ Laboratorium/20221012161651/suma.cpp | 9 +++++++++ Laboratorium/20221012161651/suma_input.cpp | 9 +++++++++ Laboratorium/20221012161651/uklad.cpp | 11 +++++++++++ 5 files changed, 46 insertions(+) create mode 100644 Laboratorium/20221012161651/kwadratowe.cpp create mode 100644 Laboratorium/20221012161651/liniowe.cpp create mode 100644 Laboratorium/20221012161651/suma.cpp create mode 100644 Laboratorium/20221012161651/suma_input.cpp create mode 100644 Laboratorium/20221012161651/uklad.cpp diff --git a/Laboratorium/20221012161651/kwadratowe.cpp b/Laboratorium/20221012161651/kwadratowe.cpp new file mode 100644 index 0000000..bf8996e --- /dev/null +++ b/Laboratorium/20221012161651/kwadratowe.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main(void) +{ + int a, b, c; + std::cin >> a >> b >> c; + double delta = b * b - 4 * (a * c); + std::cout << "x wynosi:" << (-1 * b - std::sqrt(delta)) / (2 * a) << " oraz " << (-1 * b + std::sqrt(delta)) / (2 * a) << std::endl; +} diff --git a/Laboratorium/20221012161651/liniowe.cpp b/Laboratorium/20221012161651/liniowe.cpp new file mode 100644 index 0000000..9d8e8a4 --- /dev/null +++ b/Laboratorium/20221012161651/liniowe.cpp @@ -0,0 +1,7 @@ +#include +int main(void) +{ + int a,b,c; + std::cin >> a >> b >> c; + std::cout << (c - b ) / a << std::endl; +} diff --git a/Laboratorium/20221012161651/suma.cpp b/Laboratorium/20221012161651/suma.cpp new file mode 100644 index 0000000..d60ddee --- /dev/null +++ b/Laboratorium/20221012161651/suma.cpp @@ -0,0 +1,9 @@ +#include +int main() +{ + int a,b; + a = 42; + b = 7; + std::cout << a+b << std::endl; + return 0; +} diff --git a/Laboratorium/20221012161651/suma_input.cpp b/Laboratorium/20221012161651/suma_input.cpp new file mode 100644 index 0000000..68b5ad8 --- /dev/null +++ b/Laboratorium/20221012161651/suma_input.cpp @@ -0,0 +1,9 @@ +#include +int main(void) +{ + int a,b; + std::cin >> a >> b; + std::cout << a+b << std::endl; + return 0; +} + diff --git a/Laboratorium/20221012161651/uklad.cpp b/Laboratorium/20221012161651/uklad.cpp new file mode 100644 index 0000000..dbfbb1d --- /dev/null +++ b/Laboratorium/20221012161651/uklad.cpp @@ -0,0 +1,11 @@ +#include +int main(void) +{ + int x,y; + int a1, a2; + int b1, b2; + int c1, c2; + + // here lies peter, he failed miserably. + // system of equations killed him rapidly. +}