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

Rollback to Revision 2
Source Link
Alex A.
  • 24.8k
  • 5
  • 39
  • 120

Julia, 2842 bytes - 25 = 317

print("@"^28int"@"^42(readline(r=readline())>""?int(r):2))

The length ofThis reads a line from STDIN using readline(). If it's empty, i.e. no input has been provided, then n is defined to be the programinput converted to an integer. Otherwise n is 28 bytes, so we2. We then print 28n42​n @s to STDOUT, where n is an integer read from STDIN.

Julia, 28 bytes - 25 = 3

print("@"^28int(readline())

The length of the program is 28 bytes, so we print 28n @s to STDOUT, where n is an integer read from STDIN.

Julia, 42 bytes - 25 = 17

print("@"^42((r=readline())>""?int(r):2))

This reads a line from STDIN using readline(). If it's empty, i.e. no input has been provided, then n is defined to be the input converted to an integer. Otherwise n is 2. We then print 42​n @s to STDOUT.

deleted 120 characters in body
Source Link
Alex A.
  • 24.8k
  • 5
  • 39
  • 120

Julia, 4228 bytes - 25 = 173

print("@"^42((r=readline"@"^28int())>""?intreadline(r):2))

This reads a line from STDIN using readline(). If it's empty, i.e. no input has been provided, then n is defined to beThe length of the input converted to an integer. Otherwise nprogram is 2. We then28 bytes, so we print 42​n28n @s to STDOUT, where n is an integer read from STDIN.

Julia, 42 bytes - 25 = 17

print("@"^42((r=readline())>""?int(r):2))

This reads a line from STDIN using readline(). If it's empty, i.e. no input has been provided, then n is defined to be the input converted to an integer. Otherwise n is 2. We then print 42​n @s to STDOUT.

Julia, 28 bytes - 25 = 3

print("@"^28int(readline())

The length of the program is 28 bytes, so we print 28n @s to STDOUT, where n is an integer read from STDIN.

deleted 12 characters in body
Source Link
Alex A.
  • 24.8k
  • 5
  • 39
  • 120

Julia, 4442 bytes - 25 = 1917

print("@"^42((r=readline()
n=r>"")>""?int(r):2
print("@"^44n))

This reads a line from STDIN using readline(). If it's empty, i.e. no input has been provided, then n is defined to be the input converted to an integer. Otherwise n is 2. We then print 44​42​n @s to STDOUT.

Julia, 44 bytes - 25 = 19

r=readline()
n=r>""?int(r):2
print("@"^44n)

This reads a line from STDIN using readline(). If it's empty, i.e. no input has been provided, then n is defined to be the input converted to an integer. Otherwise n is 2. We then print 44​n @s to STDOUT.

Julia, 42 bytes - 25 = 17

print("@"^42((r=readline())>""?int(r):2))

This reads a line from STDIN using readline(). If it's empty, i.e. no input has been provided, then n is defined to be the input converted to an integer. Otherwise n is 2. We then print 42​n @s to STDOUT.

Source Link
Alex A.
  • 24.8k
  • 5
  • 39
  • 120
Loading

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