From b8b13d9ee70509d6857e17b8f76e943779a67a67 Mon Sep 17 00:00:00 2001 From: Misha Date: Thu, 25 Sep 2025 18:41:17 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20summa.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- summa.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 summa.cpp diff --git a/summa.cpp b/summa.cpp new file mode 100644 index 0000000..54f343f --- /dev/null +++ b/summa.cpp @@ -0,0 +1,18 @@ +#include +using namespace std; + +int main() { + int arr[] = { 1, 2, 3, 4, 5 }; + int n = sizeof(arr) / sizeof(arr[0]); + + int* p = arr; + int sum = 0; + + for (int i = 0; i < n; i++) { + sum += *(p + i); + } + + cout << "Suma = " << sum << endl; + + return 0; +} \ No newline at end of file