Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Runtime.CompilerServices;
- namespace INFINIT
- {
- class program
- {
- static string answ1, answ2;//Entered numbers by the user
- static char[] Arr1, Arr2;//Entered numbers char arrays
- static void Main()
- {
- Start();
- }
- static void Start()
- {
- Introduction();
- getNumbers();
- stringToChar();
- printNumber(Arr1);
- }
- static void Introduction()
- {
- Console.WriteLine("Hello. This is an INFINIT program.");
- Console.WriteLine("You will have to enter 2 numbers, that are larger than int or long datatype. ");
- Console.WriteLine("Int (- 2 147 483 648 : 2 147 483 647)");
- Console.WriteLine("Long (-9 223 372 036 854 775 808 : 9 223 372 036 854 775 807)");
- Console.WriteLine();
- }
- static void getNumbers()
- {
- Console.Write("Enter the first number: ");
- answ1 = Console.ReadLine();
- Console.WriteLine();
- Console.Write("Enter the second number: ");
- answ2 = Console.ReadLine();
- }
- static void stringToChar()
- {
- static void stringToChar1()
- {
- Arr1 = new char[answ1.Length];
- Arr1 = answ1.ToCharArray();
- }
- static void stringToChar2()
- {
- Arr2 = new char[answ2.Length];
- Arr2 = answ2.ToCharArray();
- }
- }
- static void printNumber(char[]arr)
- {
- int index = 0;
- for(var i=arr.Length-1; i>=0; i--)
- {
- Console.WriteLine($"{arr[i]}*10^{index++} ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment