From 89246ee0b131de87eddb1fd88b2db2b4a6de8795 Mon Sep 17 00:00:00 2001 From: Sebastian Ranoszek Date: Wed, 22 Jan 2025 18:51:14 +0000 Subject: [PATCH] Upload files to "cpp" --- cpp/sr.cpp | 37 +++++++++++++++++++++++++++++++++++++ cpp/sum_2.cpp | 19 +++++++++++++++++++ cpp/tab3.cpp | 19 +++++++++++++++++++ cpp/zl.cpp | 24 ++++++++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 cpp/sr.cpp create mode 100644 cpp/sum_2.cpp create mode 100644 cpp/tab3.cpp create mode 100644 cpp/zl.cpp diff --git a/cpp/sr.cpp b/cpp/sr.cpp new file mode 100644 index 0000000..4900533 --- /dev/null +++ b/cpp/sr.cpp @@ -0,0 +1,37 @@ +#include +#include +using namespace std; + +int main() +{ + int a[] = {41, 558, 541, 559,63, 62, 551, 155}; + int n,i,max,min; + float sr,suma; + + n=sizeof(a)/sizeof(int); + cout<<"n = "<max) max=a[i]; + cout<<"\n max = "< null"); + return 0; +} + diff --git a/cpp/sum_2.cpp b/cpp/sum_2.cpp new file mode 100644 index 0000000..283fadb --- /dev/null +++ b/cpp/sum_2.cpp @@ -0,0 +1,19 @@ +//suma liczb parzystych +#include + +using namespace std; + +int main() +{ + int t[] = {4,7,9,3,10,2,5,6}; + int suma,i,n; + n=sizeof(t)/sizeof(t[0]); + + suma=0; + for(i=0;i