Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Console.WriteLine($"Enter {answAmount} integers: ");
- infIntArray = new string[answAmount];
- for(int i=0; i < answAmount; i++)
- {
- infIntArray[i] = Console.ReadLine();
- }
- Console.WriteLine();
- int zero = 0;
- for (int i = 0; i < infIntArray.Length; i++)
- {
- char[]Arr = infIntArray[i].ToCharArray();
- Console.Write($"{i+1}) ");
- for(int j = Arr.Length; j >0 ; j--)
- {
- Console.Write($"{Arr[j-1]}*10^{zero++} ");
- }
- zero = 0;
- Console.WriteLine();
- }
- for(int i = 0; i < infIntArray.Length; i++)
- {
- Console.WriteLine(CharToInt[i]);
- }
- }
- static void charToInt(char[]Arr)
- {
- CharToInt = new int[Arr.Length];
- for(int i=0; i<Arr.Length; i++)
- {
- switch (Arr[i])
- {
- case '0':
- CharToInt[i] = 0;
- break;
- case '1':
- CharToInt[i] = 1;
- break;
- case '2':
- CharToInt[i] = 2;
- break;
- case '3':
- CharToInt[i] = 3;
- break;
- case '4':
- CharToInt[i] = 4;
- break;
- case '5':
- CharToInt[i] = 5;
- break;
- case '6':
- CharToInt[i] = 6;
- break;
- case '7':
- CharToInt[i] = 7;
- break;
- case '8':
- CharToInt[i] = 8;
- break;
- case '9':
- CharToInt[i] = 9;
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment