From 38ec0594fac1ea30dffc2125dda0af5b31695184 Mon Sep 17 00:00:00 2001 From: PrinzEugen7 Date: Thu, 26 Nov 2015 16:10:22 +0900 Subject: [PATCH] Create sum.c --- C/Basic/sum.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 C/Basic/sum.c diff --git a/C/Basic/sum.c b/C/Basic/sum.c new file mode 100644 index 0000000..0ec1c67 --- /dev/null +++ b/C/Basic/sum.c @@ -0,0 +1,24 @@ +#include + +double sum(double data[], int n) +{ + int i; + double total = 0.0; // 変数の宣言 + + for(i=0; i