请你求出数组元素之和。
public class Program {
public static void Main() {
// 读取第一行的 n
int n = int.Parse(System.Console.ReadLine());
// 读取第二行的数组元素
string[] tokens = System.Console.ReadLine().Split();
long sum = 0; // 使用 long 类型避免溢出
for (int i = 0; i < n; i++) {
sum += long.Parse(tokens[i]); // 转换为 long 类型
}
System.Console.WriteLine(sum);
}
} 数组元素之和的最大值可能达到 (10^9 * 10^5 = 10^14),这已经超出了 C# 中 int 类型的范围(最大值约为 (2*10^9))。