From 54265d9a2b6b7de45eedfdc7492d760473227ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=83=E5=B0=A2=E5=B0=A2?= <2901032153@qq.com> Date: Fri, 15 Sep 2023 09:24:47 +0000 Subject: [PATCH 1/4] test --- main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 620a2ddb..4139ae9a 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,7 @@ #include -int main(void) { +int main(void) + { printf("Hello World\n"); return 0; -- Gitee From 24224632e99be08ce3c860d505e5bab1719fdbf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=83=E5=B0=A2=E5=B0=A2?= <2901032153@qq.com> Date: Fri, 13 Oct 2023 14:53:26 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=E4=B8=A4=E6=95=B0=E4=B9=8B=E5=92=8C?= =?UTF-8?q?=EF=BC=8C=E8=8B=8F=E5=93=A6=E6=9C=89=E5=A5=87=E6=95=B0=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E7=9A=84=E5=AD=90=E9=9B=86=E7=BB=84=E7=9A=84=E5=92=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4\346\225\260\344\271\213\345\222\214.cpp" | 16 +++++++++ ...7\273\204\347\232\204\345\222\214,cpp.cpp" | 36 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 "2209040071/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" create mode 100644 "2209040071/\346\211\200\346\234\211\347\232\204\345\245\207\346\225\260\351\225\277\345\272\246\347\232\204\345\255\220\351\233\206\347\273\204\347\232\204\345\222\214,cpp.cpp" diff --git "a/2209040071/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" "b/2209040071/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" new file mode 100644 index 00000000..c2a26b41 --- /dev/null +++ "b/2209040071/\344\270\244\346\225\260\344\271\213\345\222\214.cpp" @@ -0,0 +1,16 @@ +#include + +int sum(int num1, int num2); + +int main() { + int a, b, result; + printf("Enter two numbers: "); + scanf("%d %d", &a, &b); + result = sum(a, b); + printf("The sum of %d and %d is %d\n", a, b, result); + return 0; +} + +int sum(int num1, int num2) { + return num1 + num2; +} \ No newline at end of file diff --git "a/2209040071/\346\211\200\346\234\211\347\232\204\345\245\207\346\225\260\351\225\277\345\272\246\347\232\204\345\255\220\351\233\206\347\273\204\347\232\204\345\222\214,cpp.cpp" "b/2209040071/\346\211\200\346\234\211\347\232\204\345\245\207\346\225\260\351\225\277\345\272\246\347\232\204\345\255\220\351\233\206\347\273\204\347\232\204\345\222\214,cpp.cpp" new file mode 100644 index 00000000..09594766 --- /dev/null +++ "b/2209040071/\346\211\200\346\234\211\347\232\204\345\245\207\346\225\260\351\225\277\345\272\246\347\232\204\345\255\220\351\233\206\347\273\204\347\232\204\345\222\214,cpp.cpp" @@ -0,0 +1,36 @@ +#include + +int isOdd(int num); +int oddSubsetSum(int arr[], int size); + +int main() { + int arr[10], size, i; + printf("Enter the size of the array (max 10): "); + scanf("%d", &size); + printf("Enter the elements of the array:\n"); + for (i = 0; i < size; i++) { + scanf("%d", &arr[i]); + } + int sum = oddSubsetSum(arr, size); + printf("The sum of all odd subsets is %d\n", sum); + return 0; +} + +int isOdd(int num) { + return num % 2 != 0; +} + +int oddSubsetSum(int arr[], int size) { + int i, j, sum = 0; + for (i = 0; i < size; i++) { + if (isOdd(arr[i])) { + sum += arr[i]; + } + for (j = i + 1; j < size; j++) { + if (isOdd(arr[i] + arr[j])) { + sum += arr[i] + arr[j]; + } + } + } + return sum; +} \ No newline at end of file -- Gitee From b5c34a49d51a4c1a5e94d5c978d0b89a823e8e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E9=AA=90=E6=BB=9F?= <13420188+qianyouyou007@user.noreply.gitee.com> Date: Fri, 13 Oct 2023 15:11:11 +0000 Subject: [PATCH 3/4] update main.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邓骐滟 <13420188+qianyouyou007@user.noreply.gitee.com> --- main.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/main.cpp b/main.cpp index f59bab81..996b6a7d 100644 --- a/main.cpp +++ b/main.cpp @@ -1,10 +1,6 @@ #include - -<<<<<<< master int main(void) { printf("Hello World\n"); -======= - return 0; } -- Gitee From d4f3ec4ae1d65e12bd3c9c10d54424b2d863b5ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E9=AA=90=E6=BB=9F?= <13420188+qianyouyou007@user.noreply.gitee.com> Date: Fri, 13 Oct 2023 15:12:19 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20main?= =?UTF-8?q?.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 main.cpp diff --git a/main.cpp b/main.cpp deleted file mode 100644 index 996b6a7d..00000000 --- a/main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include -int main(void) - { - printf("Hello World\n"); - return 0; -} -- Gitee