erehh

Untitled

Oct 28th, 2022
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. using System.Runtime.CompilerServices;
  2.  
  3. namespace INFINIT
  4. {
  5. class program
  6. {
  7. static string answ1, answ2;//Entered numbers by the user
  8. static char[] Arr1, Arr2;//Entered numbers char arrays
  9.  
  10. static void Main()
  11. {
  12. Start();
  13.  
  14. }
  15.  
  16. static void Start()
  17. {
  18. Introduction();
  19.  
  20. getNumbers();
  21.  
  22. stringToChar();
  23.  
  24. printNumber(Arr1);
  25.  
  26.  
  27. }
  28.  
  29. static void Introduction()
  30. {
  31. Console.WriteLine("Hello. This is an INFINIT program.");
  32. Console.WriteLine("You will have to enter 2 numbers, that are larger than int or long datatype. ");
  33. Console.WriteLine("Int (- 2 147 483 648 : 2 147 483 647)");
  34. Console.WriteLine("Long (-9 223 372 036 854 775 808 : 9 223 372 036 854 775 807)");
  35. Console.WriteLine();
  36.  
  37. }
  38.  
  39. static void getNumbers()
  40. {
  41. Console.Write("Enter the first number: ");
  42. answ1 = Console.ReadLine();
  43. Console.WriteLine();
  44. Console.Write("Enter the second number: ");
  45. answ2 = Console.ReadLine();
  46. }
  47.  
  48. static void stringToChar()
  49. {
  50. static void stringToChar1()
  51. {
  52. Arr1 = new char[answ1.Length];
  53. Arr1 = answ1.ToCharArray();
  54. }
  55.  
  56. static void stringToChar2()
  57. {
  58. Arr2 = new char[answ2.Length];
  59. Arr2 = answ2.ToCharArray();
  60. }
  61. }
  62. static void printNumber(char[]arr)
  63. {
  64. int index = 0;
  65.  
  66. for(var i=arr.Length-1; i>=0; i--)
  67. {
  68. Console.WriteLine($"{arr[i]}*10^{index++} ");
  69. }
  70.  
  71.  
  72. }
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment