Advertisement
Qrist

23

Mar 30th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Unknown
  4. {
  5.     class Program
  6.     {
  7.  
  8.         static void Main(string[] args)
  9.         {
  10.             int num = int.Parse(Console.ReadLine());
  11.             int sum = 0;
  12.             for (int i = 0; i < num; i++)
  13.             {
  14.                 char ch = char.Parse(Console.ReadLine());
  15.                 sum += (int)ch;
  16.             }
  17.             Console.WriteLine($"The sum equals: {sum}");          
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement