- int main() {
- char string[N] = {
- '2','0','1','9'
- };
- int i;
- printf("排序前: \n");
- output(string, N);// 调用排序函数对字符数组中的字符由大到小排序
- fun(string);// 补足代码 2
- printf("\n 排序后: \n");
- output(string, N);
- printf("\n");
- system("pause");
- return 0;
- }
- void output(char x[], int n) {
- int i;
- for(i=0; i<N; i++)
- printf("%c", x[i]);
- }
来源: http://www.bubuko.com/infodetail-3314438.html