From 90a0a0c6247850fc8fc7e3fceccdc907878778ba Mon Sep 17 00:00:00 2001 From: Sebastian Ranoszek Date: Wed, 22 Jan 2025 18:50:55 +0000 Subject: [PATCH] Upload files to "cpp" --- cpp/ciag1.cpp | 25 +++++++++++++++++++++++++ cpp/fib_t.cpp | 22 ++++++++++++++++++++++ cpp/lotto.cpp | 31 +++++++++++++++++++++++++++++++ cpp/odw.cpp | 36 ++++++++++++++++++++++++++++++++++++ cpp/palindrom.cpp | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 150 insertions(+) create mode 100644 cpp/ciag1.cpp create mode 100644 cpp/fib_t.cpp create mode 100644 cpp/lotto.cpp create mode 100644 cpp/odw.cpp create mode 100644 cpp/palindrom.cpp diff --git a/cpp/ciag1.cpp b/cpp/ciag1.cpp new file mode 100644 index 0000000..43b88ee --- /dev/null +++ b/cpp/ciag1.cpp @@ -0,0 +1,25 @@ +//ciag an = 2*an-1+5 +#include +#include +using namespace std; + +int main() +{ + int i,n ; + cout<<"n = "; + cin>>n; + if(n>0) { + int *a = new int[n]; + a[0]=1; + cout< +using namespace std; + +int main() +{ + int i,n; + float zl,suma; + float f[100]; + cout<<"n = "; + cin>>n; + f[0]=0; + f[1]=1; + cout< null"); + return 0; +} + diff --git a/cpp/odw.cpp b/cpp/odw.cpp new file mode 100644 index 0000000..560bc38 --- /dev/null +++ b/cpp/odw.cpp @@ -0,0 +1,36 @@ +//odwracanie tablicy +#include +#include +using namespace std; + +int main() +{ + int i,n,j; + cout<<"n = "; + cin>>n; + int *a = new int[n]; //Dynamiczna alokacja pamieci + int *b = new int[n]; + + for(i=0;i=0;i--){ + b[j]=a[i]; + j++; + } + cout< +#include +using namespace std; + +int main() +{ + int i,j,n; + string a,b; + cout<<"Podaj tekst: "; + getline(cin,a); + n = a.length(); + + cout<