Z

@zuzannaderen

main.cpp

C++
1 year ago
#include <iostream> #include "informatyka/pierwszosc.h" #include "informatyka/systemy.h" #include "informatyka/nww.h" #include "informatyka/nwd.h" #include "informatyka/porownywanie.h" #include "informatyka/wzorzec.h" #include "informatyka/szyfrowanietekstu.h" #include "informatyka/sortowanie.h" #include "informatyka/babelkowa.h"

main.cpp

C++
1 year ago
#include <iostream> #include "informatyka/pierwszosc.cpp" #include "informatyka/systemy.cpp" #include "informatyka/nww.cpp" #include "informatyka/nwd.cpp" #include "informatyka/porownywanie.cpp" #include "informatyka/wzorzec.cpp" #include "informatyka/szyfrowanietekstu.cpp" #include "informatyka/sortowanie.cpp" #include "informatyka/babelkowa.cpp"

main.cpp

C++
1 year ago
#include <iostream> #include "pierwszosc.h" #include "systemy.h" #include "nww.h" #include "nwd.h" #include "porownywanie.h" #include "wzorzec.h" #include "szyfrowanietekstu.h" #include "sortowain.h" #include "babelkowa.h"

rekurecyjna.h

C++
1 year ago
#include <iostream> using namespace std; // Funkcja rekurencyjna do obliczania n-tego elementu ciągu Fibonacciego int fibonacci(int n) { if (n <= 0) return 0; // Dla n=0 if (n == 1) return 1; // Dla n=1 return fibonacci(n - 1) + fibonacci(n - 2); // F(n) = F(n-1) + F(n-2)

iteracyjna.h

C++
1 year ago
#include <iostream> using namespace std; // Funkcja do obliczania n-tego elementu ciągu Fibonacciego int fibonacci(int n) { if (n <= 0) return 0; // Dla n=0 if (n == 1) return 1; // Dla n=1 int a = 0; // F(0)

nominaly.h

C++
1 year ago
#include <iostream> #include <vector> using namespace std; // Funkcja do wydawania reszty void makeChange(int amount, const vector<int>& denominations) { vector<int> change; // Przechodzimy przez dostępne nominały od największego do najmniejszego

babelkowa.h

C++
1 year ago
#include <iostream> #include <vector> using namespace std; // Funkcja sortująca tablicę za pomocą sortowania bąbelkowego void bubbleSort(vector<int>& arr) { int n = arr.size(); bool swapped;

sortowaine.h

C++
1 year ago
#include <iostream> #include <vector> using namespace std; // Funkcja sortująca tablicę za pomocą sortowania przez wstawianie void insertionSort(vector<int>& arr) { int n = arr.size(); for (int i = 1; i < n; ++i) {

szyfrowanietekstu.h

C++
1 year ago
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; // Funkcja szyfrująca metodą Cezara string caesarCipher(const string &text, int shift) { string result = "";

wzorzec.h

C++
1 year ago
#include <iostream> #include <string> using namespace std; // Funkcja do wyszukiwania wzorca w tekście metodą naiwną void naiveSearch(const string& text, const string& pattern) { int n = text.length(); int m = pattern.length(); for (int i = 0; i <= n - m; i++) {

porownywanie.h

C++
1 year ago
#include <iostream> #include <string> using namespace std; int main() { string text1, text2; cout << "Podaj pierwszy tekst: "; getline(cin, text1); cout << "Podaj drugi tekst: ";

nwd.h

C++
1 year ago
#include <iostream> using namespace std; // Funkcja do obliczania NWD (największy wspólny dzielnik) za pomocą algorytmu Euklidesa int gcd(int a, int b) { while (b != 0) { int temp = b; b = a % b; a = temp; }

nww.h

C++
1 year ago
#include <iostream> using namespace std; // Funkcja do obliczania NWD (największy wspólny dzielnik) za pomocą algorytmu Euklidesa int gcd(int a, int b) { while (b != 0) { int temp = b; b = a % b; a = temp; }

systemy.h

C++
1 year ago
#include <iostream> #include <string> #include <cmath> using namespace std; // Funkcja do konwersji liczby z systemu dziesiętnego na system o podstawie base string decimalToBase(int decimal, int base) { if (decimal == 0) return "0";

pierwszosc.h

C++
1 year ago
#include <iostream> using namespace std; // Funkcja sprawdzająca, czy liczba jest pierwsza bool isPrime(int n) { if (n <= 1) return false; // liczby mniejsze lub równe 1 nie są pierwsze if (n <= 3) return true; // 2 i 3 są liczbami pierwszymi // Sprawdzamy dzielniki do pierwiastka z n for (int i = 2; i * i <= n; i++) {