Advertisement
kurec

Untitled

Feb 17th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. int BS = int.Parse(Console.ReadLine());
  2. int chislo = int.Parse(Console.ReadLine());
  3. string[]stack = new string[100];
  4. string stack1="";
  5. int ind = 0;
  6. while(chislo>=BS)
  7. {
  8. int promenliva = chislo % BS;
  9. stack[ind] = promenliva.ToString(); //String.Copy(Convert.ToString(promenliva, 5));
  10. ind++;
  11. chislo = chislo / BS;
  12. }
  13. stack[ind] = chislo.ToString();
  14. for (int i = ind; i >= 0; i--) stack1 = stack1 + stack[i];
  15. Console.Write(stack1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement