Advertisement
Guest User

Untitled

a guest
Oct 5th, 2016
1,163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading;
  7. using System.Threading.Tasks;
  8.  
  9.  
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
  15. int sum = 0;
  16. for (int i = 0; i < input.Length; i++)
  17. {
  18. int rev = 0;
  19. while (input[i] > 0)
  20. {
  21.  
  22. int r = input[i] % 10;
  23. rev = rev * 10 + r;
  24. input[i] = input[i] / 10;
  25. }
  26. sum += rev;
  27. }
  28. Console.WriteLine(sum);
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement