int sum(int a[],int n) { int i; int s = 0; for(i=0;i<n;i++) 変数sを使って総和を求める(s += ....) return s; }
変数sを使って総和を求める(s += ....)