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*

8
  • \$\begingroup\$ i just said t before , use i as type char , the actual definition would exceed by 1byte like this return -(-1)**i/16 \$\endgroup\$ Commented May 16, 2015 at 11:40
  • \$\begingroup\$ @Agawa001 , But that returns 6 for h and 7 for t. \$\endgroup\$ Commented May 16, 2015 at 11:42
  • \$\begingroup\$ oh i forgot , i must use power :p \$\endgroup\$ Commented May 16, 2015 at 11:43
  • \$\begingroup\$ Cool guy unfortunately C doesnt have such arithmetic operation thus u have to use -1*pow(-1,*i/16) which makes it waaay longer, in other hand, python and matlab use ** and ^ \$\endgroup\$ Commented May 16, 2015 at 11:56
  • 1
    \$\begingroup\$ @CoolGuy would using puts puts(*i>'h'?"-1":"1"); not be better? (22 bytes) \$\endgroup\$ Commented May 20, 2015 at 12:45