fork download
  1. using static System.Console;
  2. using System.Numerics;
  3.  
  4. public class Program {
  5. public static void Main() => WriteLine(DecimalParaBinario(BigInteger.Parse("1231231231231231231231231232312312312")));
  6. static string DecimalParaBinario(BigInteger n) {
  7. BigInteger resto;
  8. var result = "";
  9. while (n > 0) {
  10. resto = n % 2;
  11. n /= 2;
  12. result = resto.ToString() + result;
  13. }
  14. return result.ToString();
  15. }
  16. }
  17.  
  18. //https://pt.stackoverflow.com/q/101472/101
Success #stdin #stdout 0.02s 17012KB
stdin
Standard input is empty
stdout
111011010010000001100010111100000000110001000100101011111101101111111100001111100001001111110011100011111000000111111000