Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- public class CBTDecimal
- {
- public static void Main()
- {
- string input = Console.ReadLine();
- string[] cut = input.Split(new char[0], StringSplitOptions.RemoveEmptyEntries);
- double numBase = double.Parse(cut[0]);
- string number = cut[1];
- int length = number.Length;
- double result = 0;
- double power = 0;
- for (int i = length - 1; i >= 0; i--)
- {
- string numerator = number[i].ToString();
- result += Math.Pow(numBase, power)*double.Parse(numerator);
- power++;
- }
- Console.WriteLine(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement