We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {
static long aVeryBigSum(int n, long[] ar) {
// Complete this function
Int64 total = 0;
for(int i=0; i < n; i++)
{
total +=ar[i];
}
return total;
}
static void Main(String[] args) {
int n = Convert.ToInt32(Console.ReadLine());
string[] ar_temp = Console.ReadLine().Split(' ');
long[] ar = Array.ConvertAll(ar_temp,Int64.Parse);
long result = aVeryBigSum(n, ar);
Console.WriteLine(result);
}
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
A Very Big Sum
You are viewing a single comment's thread. Return to all comments →
Solve in C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution {
}