int main() { /* reverse the order of words within a string */ char str[] = " this is a test "; printf("'%s'\n", str); reversewords(str); printf("'%s'\n", str); /* find the first non-repeated character */ // use hash or 64 bit mask /* find if all characters are unique */ char string[] = "asdfqwersdfga"; printf("Characters in %s are %s unique\n", string, uniqueCharac1(string)? " " : "not"); printf("Characters in %s are %s unique\n", string, uniqueCharac2(string)? " " : "not"); /* remove characters from string */ char str2[] = "this is a test"; char remove[] = {'a', 'b', 's'}; printf("String: '%s'\n", str2); removechars1(str2, remove, 3); printf("String without '%s': '%s'\n", remove, str2); return 0; }
int main() { char str[] = " a fox quickly jumps"; char * s = str; reversewords(s); printf("%s",s); return 0; }
int main() { char s[] = "This is the reverse sentence."; char *temp = s; printf("Original string: %s\n",s); reversewords(s); printf("Reverse word string: %s\n", s); return 0; }
int main(){ char str[] = "i like this programing very much"; printf("%s\n",str); reversewords(str); printf("%s",str); }
void testreversewords(){ std::string s = "Alice likes Bob"; reversewords(s); }