tmollov

Untitled

Feb 3rd, 2017
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace console
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int number = int.Parse(Console.ReadLine());
  14. int basse = int.Parse(Console.ReadLine());
  15. string res = "";
  16. while(number > 0)
  17. {
  18. int reminder = number % basse;
  19.  
  20. number /= basse;
  21. res += reminder.ToString();
  22. }
  23. foreach (var a in res.Reverse())
  24. {
  25. Console.Write(a);
  26. }
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment