Skip to content

Instantly share code, notes, and snippets.

@hitode909
Created December 16, 2009 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitode909/257577 to your computer and use it in GitHub Desktop.
Save hitode909/257577 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <ctype.h>
int main(int argc, char *argv[]) {
int i, j, found = 0;
char* s;
for (i = 1; i < argc; i++) {
s = argv[i];
if (found) {
printf("%s", s);
} else {
for(j = 0; s[j] != '\0'; j++) {
if (isupper(s[j]) == 0) {
putc(s[j], stdout);
} else {
printf(" %c%s", tolower(s[j]), (s[j+1] != '\0') ? &s[j+1] : "");
found = 1;
break;
}
}
}
if (i < argc-1) printf(" ");
}
return found;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment