我不理解
这个题目是什么,该字母后续要求字母这地方不太明白,下面代码是猜的,供参考:
#include <stdio.h>
#include <string.h>
int main()
{
int i, j;
char str[128], ch, t;
scanf("%s", str);
scanf(" %c", &ch);
for (i = strlen(str) - 1; i > 0; i--)
for (j = 0; j < i; j++){
if (str[j] > str[j+1])
t = str[j], str[j] = str[j+1], str[j+1] = t;
}
printf("排列好的字符串为:%s\n",str);
printf("该字母后续要求字母为:");
for (i = 0;i < strlen(str); i++){
if (str[i] - ch == 1 || str[i] - ch == 2)
printf("%c",str[i]);
}
return 0;
}