Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text.RegularExpressions;
  5.  
  6. namespace _6._Sum_Reversed_Numbers
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. List<string> input = Console.ReadLine().Split().ToList();
  13.  
  14. int sum = 0;
  15.  
  16. foreach (var s in input)
  17. {
  18. sum += int.Parse(Reverse(s));
  19. }
  20.  
  21. Console.Write(sum);
  22. }
  23.  
  24.  
  25. public static string Reverse(string s)
  26. {
  27. char[] charArray = s.ToCharArray();
  28. Array.Reverse(charArray);
  29. return new string(charArray);
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement