#include <stdio.h> #include <string.h> int main() { char arr[502] = {-1}; memset(arr, -1, 502); //去除末尾的 "\r\n" fgets(arr, 502, stdin); arr[strcspn(arr,"\n")] = -1; arr[strcspn(arr,"\r")] = -1; //scanf("%s", arr); ...