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.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication55
- {
- class Program
- {
- static void Main(string[] args)
- {
- string a = "14";
- int b = 13;
- int c = 8;
- try
- {
- if (b == 13)
- {
- int temp = Convert.ToInt32(a, b);
- Console.WriteLine(Convert.ToString(temp, c));
- }
- else
- {
- Int64 temp = Convert.ToInt64(a, b);
- Console.WriteLine(Convert.ToString(temp, c));
- }
- }
- catch(Exception)
- {
- Console.WriteLine("Некорректное значение параметра!");
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement