SHOW:
|
|
- or go back to the newest paste.
| 1 | using System; | |
| 2 | ||
| 3 | namespace ConsoleInputOutput | |
| 4 | {
| |
| 5 | public static class SumOfN | |
| 6 | {
| |
| 7 | public static void Main() | |
| 8 | {
| |
| 9 | long n = long.Parse(Console.ReadLine()); | |
| 10 | - | long sum = 0; |
| 10 | + | decimal sum = 0.00m; |
| 11 | - | long number = long.MinValue; |
| 11 | + | decimal number = decimal.MinValue; |
| 12 | for (int i = 0; i < n; i++) | |
| 13 | {
| |
| 14 | - | number = long.Parse(Console.ReadLine()); |
| 14 | + | number = decimal.Parse(Console.ReadLine()); |
| 15 | sum += number; | |
| 16 | } | |
| 17 | Console.WriteLine(sum); | |
| 18 | } | |
| 19 | } | |
| 20 | } |