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 Revisions

2 of 6
deleted 3 characters in body
badatgolf
  • 1.5k
  • 6
  • 25

C (gcc), 56 bytes

a,n;f(char*s){for(a=0,n=strlen(s);n--;++s)a+=*s-48;a=a;}

Try it online!

Takes input as a string.

badatgolf
  • 1.5k
  • 6
  • 25

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