Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Numerics;
- namespace ExamPreparation
- {
- public sealed class Preparation
- {
- public static void Main()
- {
- BigInteger[] tokens = Console.ReadLine()
- .Split()
- .Select(BigInteger.Parse)
- .ToArray();
- BigInteger @base = tokens[0];
- BigInteger number = tokens[1];
- string result = string.Empty;
- if (@base >= 2 && @base <= 10)
- {
- while (number > 0)
- {
- BigInteger remainder = number % @base;
- number /= @base;
- result = remainder.ToString() + result;
- }
- Console.WriteLine(result);
- }
- else
- {
- Console.WriteLine(0);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement