Domande taggate «base-conversion»

Conversione di numeri tra sistemi numerici posizionali. I sistemi più comuni sono decimali, binari, esadecimali ecc.

16
Da esadecimale a binario
Converti un numero esadecimale (di qualsiasi dimensione) in un numero binario. Immettere un numero esadecimale POSITIVO con 0xa all'inizio. Un ingresso valido corrisponde sempre la seguente espressione regolare: 0x[0-9a-fA-F]+. Se l'input non è un numero esadecimale valido, ovvero qualsiasi cosa non corrisponda a questa regex, l'output dovrebbe essere 0. Output …

6
Numeri che sono palindromi in N basi
Dato un numero intero non negativo n >= 0, genera per sempre la sequenza di numeri interi x_i >= 3che sono palindromi in nbasi esattamente diverse b, dove può essere la base 2 <= b <= x_i-2. Questo è fondamentalmente l'inverso di OEIS A126071 , dove vengono emessi gli indici …
10 code-golf  sequence  base-conversion  palindrome  code-golf  array-manipulation  matrix  code-golf  string  ascii-art  code-golf  ascii-art  physics  code-golf  number  sequence  fibonacci  code-golf  ascii-art  packing  code-golf  string  hexadecimal  code-challenge  restricted-source  decision-problem  binary  code-golf  code-golf  code-golf  stack-exchange-api  code-golf  string  parsing  generation  data-structures  code-golf  kolmogorov-complexity  graphical-output  code-golf  array-manipulation  integer  generation  data-structures  code-golf  number  random  probability-theory  king-of-the-hill  java  minesweeper  code-golf  string  kolmogorov-complexity  animation  code-golf  string  code-golf  code-golf  quine  code-golf  internet  code-golf  arithmetic  base-conversion 

7
Codifica Base85
La sfida Scrivi un programma che può prendere l'input di una stringa a riga singola contenente qualsiasi carattere stampabile ASCII e produrre la stessa stringa codificata in Base85 (usando una convenzione big-endian). Si può presumere che l'input sarà sempre di ≤ 100 caratteri. Una guida a Base85 Quattro ottetti sono …

10
Convertire una matrice di byte in base64
La tua missione è quella di scrivere una funzione / programma che converta una matrice di byte (cioè una matrice di numeri interi da 0 a 255), in base64. L'uso degli encoder base64 integrati non è consentito. L'implementazione base64 richiesta è RFC 2045. (utilizzando "+", "/" e riempimento obbligatorio con …

30
Dato un input int n, stampa n * invertito (n)
Dato un numero intero n, stampan * reversed(n) reversed(n)è il numero che ottieni quando hai reversele cifre di n. reverse(512) = 215 reverse(1) = 1 reverse(101) = 101 >>>>>>>> func(5) = 5*5 = 25 func(12) = 12*21 = 252 func(11) = 11*11 = 121 func(659) = 659*956 = 630004 Vince …
9 code-golf  math  arithmetic  code-golf  math  integer  code-golf  arithmetic  integer  code-golf  sequence  base-conversion  palindrome  code-golf  math  primes  integer  code-golf  parsing  conversion  syntax  code-golf  sequence  primes  code-challenge  geometry  optimization  code-golf  graph-theory  code-golf  number-theory  primes  integer  code-golf  source-layout  cops-and-robbers  code-golf  source-layout  cops-and-robbers  code-golf  sequence  primes  integer  code-golf  math  number-theory  primes  rational-numbers  code-golf  math  sequence  number-theory  primes  code-golf  string  code-golf  math  combinatorics  permutations  restricted-complexity  code-golf  array-manipulation  code-golf  number  sequence  code-golf  number  sequence  code-golf  binary-matrix  code-golf  math  tips  javascript  algorithm  code-golf  string  code-golf  number  sequence  code-golf  math  arithmetic  parsing  code-golf  number  sequence  primes  code-golf  string  ascii-art  geometry  integer  code-golf  geometry  code-golf  number  array-manipulation  code-golf  math  geometry  code-golf  number  sequence  arithmetic  integer  code-golf  string  kolmogorov-complexity  code-golf  number  code-golf  number  chess  code-golf  sequence  decision-problem  subsequence  code-golf  math  number  primes  code-golf  primes  permutations  code-golf  integer  probability-theory  statistics  code-golf  string  code-golf  sequence  decision-problem  parsing  board-game  code-golf  binary  graph-theory  code-golf  board-game  classification  tic-tac-toe  code-golf  ascii-art  polyglot  code-golf  date  code-golf  geometry 

14
L'espansione binaria binaria
Normalmente, scomponiamo un numero in cifre binarie assegnandolo con potenze di 2, con un coefficiente di 0o 1per ogni termine: 25 = 1*16 + 1*8 + 0*4 + 0*2 + 1*1 La scelta di 0ed 1è ... non molto binaria. Eseguiremo la vera espansione binaria espandendola con potenze di 2, …



2
Cambio base ereditaria
sfondo In questa sfida, una rappresentazione baseb di un numero intero nè un'espressione di nuna somma di poteri di b, in cui ogni termine si verifica nella maggior parte dei b-1casi. Ad esempio, la 4rappresentazione base di 2015è 4^5 + 3*4^4 + 3*4^3 + 4^2 + 3*4 + 3 Ora, …
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.