Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#Languages - 4

Languages - 4

I always love an excuse to pull out good old ##QBasic, (削除) 112 (削除ここまで) 96 bytes

QBasic, (削除) 112 (削除ここまで) 96 bytes

##Prolog, 235 bytes

Prolog, 235 bytes

#Languages - 4

I always love an excuse to pull out good old ##QBasic, (削除) 112 (削除ここまで) 96 bytes

##Prolog, 235 bytes

Languages - 4

I always love an excuse to pull out good old

QBasic, (削除) 112 (削除ここまで) 96 bytes

Prolog, 235 bytes

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Same strategy as Dennis's Dennis's Python 2 version. Takes a comma-separated list of numbers; handles both ints and floats. A single-number input must be wrapped in square braces (and a list of numbers always may be); a fix would cost 4 bytes.

Same strategy as Dennis's Python 2 version. Takes a comma-separated list of numbers; handles both ints and floats. A single-number input must be wrapped in square braces (and a list of numbers always may be); a fix would cost 4 bytes.

Same strategy as Dennis's Python 2 version. Takes a comma-separated list of numbers; handles both ints and floats. A single-number input must be wrapped in square braces (and a list of numbers always may be); a fix would cost 4 bytes.

Added Python 3 version
Source Link
DLosc
  • 40.7k
  • 6
  • 87
  • 142

#Languages - 34

 ?- m([8.6],H,G,A,Q,C).
 H = G, G = A, A = Q, Q = C, C = 8.6.

Python 3, 103 bytes

h=a=q=n=0;g=1
for x in eval(input()):h+=1/x;g*=x;a+=x;q+=x*x;n+=1
print(n/h,g**(1/n),a/n,(q/n)**.5,q/a)

Same strategy as Dennis's Python 2 version. Takes a comma-separated list of numbers; handles both ints and floats. A single-number input must be wrapped in square braces (and a list of numbers always may be); a fix would cost 4 bytes.

#Languages - 3

 ?- m([8.6],H,G,A,Q,C).
 H = G, G = A, A = Q, Q = C, C = 8.6.

#Languages - 4

 ?- m([8.6],H,G,A,Q,C).
 H = G, G = A, A = Q, Q = C, C = 8.6.

Python 3, 103 bytes

h=a=q=n=0;g=1
for x in eval(input()):h+=1/x;g*=x;a+=x;q+=x*x;n+=1
print(n/h,g**(1/n),a/n,(q/n)**.5,q/a)

Same strategy as Dennis's Python 2 version. Takes a comma-separated list of numbers; handles both ints and floats. A single-number input must be wrapped in square braces (and a list of numbers always may be); a fix would cost 4 bytes.

Shortened Prolog example output
Source Link
DLosc
  • 40.7k
  • 6
  • 87
  • 142
Loading
Added Prolog version
Source Link
DLosc
  • 40.7k
  • 6
  • 87
  • 142
Loading
Shortened QBasic version
Source Link
DLosc
  • 40.7k
  • 6
  • 87
  • 142
Loading
Added Common Lisp
Source Link
DLosc
  • 40.7k
  • 6
  • 87
  • 142
Loading
Source Link
DLosc
  • 40.7k
  • 6
  • 87
  • 142
Loading

AltStyle によって変換されたページ (->オリジナル) /