Advertisement
Spocoman

02. Ascii Sumator

Apr 17th, 2023
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.Text;
  5.  
  6. namespace AsciiSumator
  7. {
  8.  
  9.     class Program
  10.     {
  11.         static void Main()
  12.         {
  13.             char first = char.Parse(Console.ReadLine());
  14.             char last = char.Parse(Console.ReadLine());
  15.  
  16.             var sum = Console.ReadLine()
  17.                 .ToCharArray()
  18.                 .Where(x => x > first && x < last)
  19.                 .Sum(x => x);
  20.  
  21.             Console.WriteLine(sum);
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement