Competitive Programming Solutions

GitHub
back to dashboard

L. Summation

Codeforces - Sheet #7 (Recursion) · limit: 1s · memory: 256MB · view on codeforces

input

4
1 4 2 7

output

14
Main.java
static void solve() {

        // Write your solution here
        int n = in.nextInt();
        int[] a = readIntArray(n);
        out.println(summation(a, 0));
    }