1
0

Program.cs 549 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.IO;
  3. namespace Adv2018
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. if (args.Length < 1) return;
  10. var file = File.OpenText(args[0]);
  11. int frequency = 0;
  12. do
  13. {
  14. var line = file.ReadLine();
  15. if (line == null) break;
  16. var freq = int.Parse(line);
  17. frequency += freq;
  18. } while (true);
  19. Console.WriteLine($"Result : {frequency}");
  20. }
  21. }
  22. }