自己试的一些样例输出都是正确的,为什么提交上去就全wa了
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
char str[100];
fgets(str, 100, stdin);
str[strcspn(str,"\n")] = '\0';
char *word = strtok(str," ");
while (word != NULL) {
int len = strlen(word);
char *new = (char*)malloc((len+1) * sizeof(char));
if (new != NULL) {
for (int i = 0; i < len; i++) {
new[i] = word[len - 1- i];
}
new[len] = '\0';
printf("%s\n",new);
free(new);
word = strtok(NULL," ");
}
}
return 0;
}```