Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace SumReversedNumbers
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<int> seq = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
- long sum = 0;
- for (int i = 0; i < seq.Count; i++)
- {
- int num = seq[i];
- string reversed = "";
- while(num > 0)
- {
- int lastDigit = num % 10;
- reversed += lastDigit;
- num /= 10;
- }
- sum += int.Parse(reversed);
- }
- Console.WriteLine(sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement