Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • \$\begingroup\$ You can replace c=='\0' with !c for the same effect. \$\endgroup\$ Commented Sep 14, 2017 at 3:57
  • \$\begingroup\$ Awesome thanks just updated the solution! \$\endgroup\$ Commented Sep 14, 2017 at 4:46
  • \$\begingroup\$ Can you use printf("%*s%c", n, "", c) to print the the char c with n leading spaces? \$\endgroup\$ Commented Sep 14, 2017 at 5:29
  • \$\begingroup\$ I'm pretty sure you can save few bytes by replacing (c!=n) with c-n and rearranging ternary expressions. Same with (c=='/'). Also, you can replace '/' with literal number 47. I think it is 7 bytes in total. \$\endgroup\$ Commented Sep 14, 2017 at 6:50
  • 1
    \$\begingroup\$ 78 bytes \$\endgroup\$ Commented Sep 14, 2017 at 7:26