Domande taggate «arithmetic»

Sfide legate all'aritmetica elementare.

30
Triangoli ASCII
Il tuo compito è scrivere un programma o una funzione che stampa un triangolo ASCII. Sembrano così: |\ | \ | \ ---- Il tuo programma prenderà un singolo input numerico n, con i vincoli 0 <= n <= 1000. Il triangolo sopra aveva un valore di n=3. Il triangolo …
30 code-golf  ascii-art  code-golf  rubiks-cube  code-golf  path-finding  maze  regular-expression  code-golf  math  rational-numbers  code-golf  kolmogorov-complexity  graphical-output  code-golf  tips  code-golf  string  permutations  code-golf  sorting  base-conversion  binary  code-golf  tips  basic  code-golf  number  number-theory  fibonacci  code-golf  date  code-golf  restricted-source  quine  file-system  code-golf  code-golf  math  code-golf  ascii-art  code-golf  math  primes  code-golf  code-golf  math  matrix  code-golf  string  math  logic  factorial  code-golf  palindrome  code-golf  quine  stateful  code-golf  interactive  code-golf  board-game  code-golf  math  arithmetic  code-golf  string  code-golf  math  matrix  code-golf  math  abstract-algebra  polynomials  code-golf  date  code-golf  string  array-manipulation  sorting  code-golf  game  code-golf  string  code-golf  ascii-art  decision-problem  code-golf  number  sequence  code-golf  code-golf  code-golf  sequence  fibonacci  code-golf  math  geometry  random  code-golf  code-golf  math  decision-problem  fractal  rational-numbers  code-golf  number  number-theory  code-golf  combinatorics  permutations  card-games  code-golf  math  sequence  array-manipulation  fibonacci  code-golf  sequence  decision-problem  graph-theory  code-golf  ascii-art  parsing  lisp  code-golf  string  math  natural-language  logic  code-golf  math  logic  code-golf  string  alphabet  code-golf  string  code-golf  string 

27
Differenza di tre numeri interi di input
Implementa una funzione diff che accetta come input tre numeri interi x, ye z. Dovrebbe restituire se sottrarre uno di questi numeri da un altro dà il terzo. Test cases: diff(5, 3, 2) yields True because 5 - 3 = 2 diff(2, 3, 5) yields True because 5 - 3 …

3
Aiuto! La mia calcolatrice si è rotta! (Trasforma l'espressione intera in sequenze di tasti della calcolatrice)
introduzione Aiuto! Ho accidentalmente lasciato cadere la calcolatrice TI-84 fuori dalla finestra (non chiedere come) e si è rotto. Domani ho un test di matematica e l'unica calcolatrice che posso trovare è una con questi pulsanti: 7 8 9 + 4 5 6 - 1 2 3 * 0 = …

24
La sequenza RATS
Il tuo compito è generare l'ennesimo termine della sequenza RATS, dove n è l'input. La sequenza RATS è anche nota come sequenza Aggiungi quindi ordina inversa. Questa sequenza può essere trovata anche qui: http://oeis.org/A004000 . casi test: 0 > 1 1 > 2 2 > 4 3 > 8 4 …




16
Moltiplica due numeri senza usare alcun numero
Vengono fornite come input due stringhe che rappresentano numeri interi positivi nella base 10, come "12345"e "42". Il tuo compito è quello di produrre una stringa contenente il loro prodotto, "518490"in questo caso. La svolta è che non puoi usare alcun tipo numerico nel tuo codice. No ints, floats, unsigned …

16
Triplici pitagorici primitivi
( correlato ) Una tripla pitagorica è un elenco (a, b, c)che soddisfa l'equazione a 2 + b 2 = c 2 . Un triplo pitagorico primitivo (PPT) è uno in cui a, be csono tutti coprimi (cioè, l'unico divisore comune tra i tre elementi è 1). Ad esempio, il …

13
Somme delle colonne di Pascal
Quasi tutti qui conoscono il triangolo di Pascal. È formato da file successive, dove ogni elemento è la somma dei suoi due vicini in alto a sinistra e in alto a destra. Ecco le prime 5righe (prese in prestito dal triangolo di Generate Pascal ): 1 1 1 1 2 …



16
Semplifica una radice quadrata
Dato un numero intero positivo n, semplifica la radice quadrata √nnella forma a√bestraendo tutti i fattori quadrati. Gli output a,bdovrebbero essere numeri interi positivi n = a^2 * bcon il bpiù piccolo possibile. È possibile produrre ae bin qualsiasi ordine in qualsiasi formato ragionevole. Non è possibile omettere gli output …

28
Calcola il super-logaritmo
Questa dovrebbe essere una sfida semplice. Dato un numero n >= 0, genera il super-logaritmo (o il log *, log-star o logaritmo iterato , che sono equivalenti poiché nnon è mai negativo per questa sfida.) nDi. Questa è una delle due funzioni inverse rispetto alla tetrazione . L'altro è il …
29 code-golf  math  code-golf  array-manipulation  sorting  code-golf  math  arithmetic  matrix  code-golf  string  kolmogorov-complexity  code-golf  string  code-golf  math  sequence  arithmetic  recursion  code-golf  math  ascii-art  sequence  code-golf  math  array-manipulation  code-golf  code-golf  kolmogorov-complexity  code-golf  string  code-golf  string  decision-problem  code-golf  array-manipulation  tips  javascript  json  code-golf  math  string  number  number-theory  code-golf  math  sequence  fibonacci  number  arithmetic  fastest-code  integer  code-golf  math  sequence  code-golf  string  file-system  tips  golfscript  code-golf  string  code-golf  string  natural-language  code-golf  string  file-system  code-golf  math  array-manipulation  code-challenge  image-processing  compression  code-golf  math  number  sequence  code-golf  math  combinatorics  regular-expression  code-golf  sequence  pi  code-golf  ascii-art  code-golf  string  array-manipulation  sorting  code-golf  string  graph-theory  code-golf  string  code-golf  string  ascii-art  code-challenge  compression  code-golf  code-golf  math  sequence  number-theory  code-golf  maze  graph-theory  code-golf  math  sequence 

3
Complessità intera
Il tuo compito è scrivere un programma che, sull'input n, emetta l' espressione minima di ciascun numero da 1 a n in ordine. Vince il programma più breve in byte. Un'espressione minima combina 1 con addizione e moltiplicazione per ottenere il numero dato, usando il minor numero possibile di 1. …

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.