题解 | #字符逆序#
字符逆序
https://www.nowcoder.com/practice/cc57022cb4194697ac30bcb566aeb47b
#include <stdio.h>
#include <string.h>
#define MAX_LEN 10000
int main() {
char str[MAX_LEN];
while (fgets(str, sizeof(str), stdin) != NULL) {
int len = strlen(str);
for(int i = len - 2; i >= 0; i--) {
putchar(str[i]);
}
printf("\n");
}
return 0;
}

查看9道真题和解析