Skip to main content
added 54 characters in body
Source Link
lynn
  • 69.2k
  • 11
  • 133
  • 283

C, 6363 60 bytes

f(char*s){for(;*s;s++)isalpha(putchar(*s),isalpha(*s)&&putchar(32^*s);}

Uses the fact that 'a' XOR 32 == 'A', etc.

Three bytes saved thanks to FryAmTheEggman.

C, 63 bytes

f(char*s){for(;*s;s++)putchar(*s),isalpha(*s)&&putchar(32^*s);}

Uses the fact that 'a' XOR 32 == 'A', etc.

C, 63 60 bytes

f(char*s){for(;*s;s++)isalpha(putchar(*s))&&putchar(32^*s);}

Uses the fact that 'a' XOR 32 == 'A', etc.

Three bytes saved thanks to FryAmTheEggman.

Source Link
lynn
  • 69.2k
  • 11
  • 133
  • 283

C, 63 bytes

f(char*s){for(;*s;s++)putchar(*s),isalpha(*s)&&putchar(32^*s);}

Uses the fact that 'a' XOR 32 == 'A', etc.