Tag: 区分大小写的

如何按字母顺序对字符串数组进行排序(区分大小写,非标准排序规则)

我需要ac语言代码来排序一些字符串,它应该区分大小写, 对于大写和小写的相同字母,小写必须首先 。 例如,以下字符串的排序结果: eggs bacon cheese Milk spinach potatoes milk spaghetti 应该: bacon cheese eggs milk Milk potatoes spaghetti spinach 我写了一段代码,但结果是: Milk bacon cheese eggs milk potatoes spaghetti spinach 我不知道如何改进这个,我已经搜索了很多。 任何人都可以帮我这个吗? #include #include int main(){ char c; char name[20][10], temp[10]; int count_name = 0; int name_index = 0; int i, j; while ((c = […]