Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Numerics;
- namespace Convert_from_base_10_to_base_N
- {
- class Program
- {
- static void Main(string[] args)
- {
- BigInteger[] input = Console.ReadLine().Split().Select(BigInteger.Parse).ToArray();
- BigInteger toBase = input[0];
- BigInteger num = input[1];
- BigInteger reminder = 0;
- List<BigInteger> result = new List<BigInteger>();
- while ( num > 0)
- {
- reminder = num % toBase;
- result.Add(reminder);
- num /= toBase;
- }
- result.Reverse();
- Console.WriteLine(string.Join("",result));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement