Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- class Program
- {
- static void Main(string[] args)
- {
- int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
- ReverseDigits(arr);
- Console.WriteLine(string.Join(" ", arr));
- }
- private static void ReverseDigits(int[] arr)
- {
- int reversed = 0;
- for (int i = 0; i < arr.Length; i++)
- {
- while (arr[i] > 0)
- {
- reversed = reversed * 10 + arr[i] % 10;
- arr[i] = arr[i] / 10;
- }
- arr[i] = reversed;
- reversed = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement