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

added 114 characters in body
Source Link
Alkano
  • 217
  • 2
  • 5

C (gcc), 4035 bytes

f(char*s){while(*s)putchar(*s),*s++-48?:s++;}

48 is the ascii code of '0'

better version 43 bytes as suggested by Neil

f(char*s){while(*s)putchar(*s),s+=2-*s%2;}

another one 40 byte this time (again as suggested by Neil & VisualMelon) :)

f(char*s){for(;*s;s+=50-*s)putchar(*s);}

Try it online! and then 35 bytes thanks to Khaled.K

f(char*s){*s&&f(s+50-putchar(*s));}

Try it online!

C (gcc), 40 bytes

f(char*s){while(*s)putchar(*s),*s++-48?:s++;}

48 is the ascii code of '0'

better version 43 bytes as suggested by Neil

f(char*s){while(*s)putchar(*s),s+=2-*s%2;}

another one 40 byte this time (again as suggested by Neil & VisualMelon) :)

f(char*s){for(;*s;s+=50-*s)putchar(*s);}

Try it online!

C (gcc), 35 bytes

f(char*s){while(*s)putchar(*s),*s++-48?:s++;}

48 is the ascii code of '0'

better version 43 bytes as suggested by Neil

f(char*s){while(*s)putchar(*s),s+=2-*s%2;}

another one 40 byte this time (again as suggested by Neil & VisualMelon) :)

f(char*s){for(;*s;s+=50-*s)putchar(*s);}

and then 35 bytes thanks to Khaled.K

f(char*s){*s&&f(s+50-putchar(*s));}

Try it online!

added 8 characters in body
Source Link
Alkano
  • 217
  • 2
  • 5

C (gcc), 4140 bytes

f(char*s){while(*s)putchar(*s),*s++-48?:s++;}

48 is the ascii code of '0'

better version 43 bytes as suggested by Neil

f(char*s){while(*s)putchar(*s),s+=2-*s%2;}

another one 4140 byte this time (again as suggested by Neil Neil & VisualMelon) :)

f(char*s){for(;*s;s+=2;*s;s+=50-*s%2*s)putchar(*s);}

Try it online! Try it online!

C (gcc), 41 bytes

f(char*s){while(*s)putchar(*s),*s++-48?:s++;}

48 is the ascii code of '0'

better version 43 bytes as suggested by Neil

f(char*s){while(*s)putchar(*s),s+=2-*s%2;}

another one 41 byte this time (again as suggested by Neil) :)

f(char*s){for(;*s;s+=2-*s%2)putchar(*s);}

Try it online!

C (gcc), 40 bytes

f(char*s){while(*s)putchar(*s),*s++-48?:s++;}

48 is the ascii code of '0'

better version 43 bytes as suggested by Neil

f(char*s){while(*s)putchar(*s),s+=2-*s%2;}

another one 40 byte this time (again as suggested by Neil & VisualMelon) :)

f(char*s){for(;*s;s+=50-*s)putchar(*s);}

Try it online!

added 381 characters in body
Source Link
Alkano
  • 217
  • 2
  • 5

CC (gcc), 4341 bytes

f(char*s){while(*s)putchar(*s),*s++-48?:s++;}

48 is the ascii code of '0'

better version 43 bytes as suggested by Neil

f(char*s){while(*s)putchar(*s),s+=2-*s%2;}

another one 41 byte this time (again as suggested by Neil) :)

f(char*s){for(;*s;s+=2-*s%2)putchar(*s);}

Try it online!

C, 43 bytes

f(char*s){while(*s)putchar(*s),*s++-48?:s++;}

48 is the ascii code of '0'

better version 43 bytes as suggested by Neil

f(char*s){while(*s)putchar(*s),s+=2-*s%2;}

C (gcc), 41 bytes

f(char*s){while(*s)putchar(*s),*s++-48?:s++;}

48 is the ascii code of '0'

better version 43 bytes as suggested by Neil

f(char*s){while(*s)putchar(*s),s+=2-*s%2;}

another one 41 byte this time (again as suggested by Neil) :)

f(char*s){for(;*s;s+=2-*s%2)putchar(*s);}

Try it online!

deleted 2 characters in body
Source Link
Steadybox
  • 16.6k
  • 5
  • 42
  • 84
Loading
added 97 characters in body
Source Link
Alkano
  • 217
  • 2
  • 5
Loading
Source Link
Alkano
  • 217
  • 2
  • 5
Loading

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