Files
  • main.cs
  • main.exe
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using System;

class SumNumbersWithForLoop {
    public static void Main() {
        int n = int.Parse(Console.ReadLine());
        long sum = 0;
        for (int i = 0; i < n; i++)
        {
            int num = int.Parse(Console.ReadLine());
            sum += num;
        }
        Console.WriteLine("Sum = {0}", sum);
    }
}