将一个字符串的元音字母复制到另一个字符串,并排序(30分)
问题描述:
有一字符串,里面可能包含英文字母(大写、小写)、数字、特殊字符,现在需要实现一函数,将此字符串中的元音字母挑选出来,存入另一个字符串中,并对字符串中的字母进行从小到大的排序(小写的元音字母在前,大写的元音字母在后,依次有序)。
说明:
1、 元音字母是a,e,i,o,u,A,E,I,O,U。
2、 筛选出来的元音字母,不需要剔重(chong);
最终输出的字符串,小写元音字母排在前面,大写元音字母排在后面,依次有序。
要求实现函数:
void sortVowel (char* input, char* output);
【输入】 char* input,表示输入的字符串
【输出】 char* output,排好序之后的元音字符串。
【返回】 无
示例
输入:char *input = “Abort!May Be Some Errors In Out System. “
输出:char *output =“aeeeooouAEIO “
1 #include<stdio.h> 2 void sortVowel (char* input, char* output) 3 { 4 int c[256]; 5 int i; 6 const char *p = input; 7 for (i=0; i < 256; i++) 8 c[i] = 0; 9 while (*p != '