#include <stdio.h> #include <string.h> #include <stddef.h> int main() { char str[5002]; while (fgets(str, sizeof(str), stdin) != NULL) { str[strcspn(str,"\n")] = '\0'; int lengthofstr = strlen(str); char *last_space = strrchr(str, ' '); ...