/*************************************** * String consisting of uppercase and lowercase letters, now, you need to modify the name and place all the lower-case letters in front of the acknowledgment letter (the original order is not required between the upper and lower-case letters ), if possible, the time and space efficiency should be selected as much as possible. Algorithm C Language Function prototype void proc (char * Str) you can also use the language you are familiar *//***************************** **************************************** * ** // use the segmentation concept O (n) in quick sorting) void proc (char * Str) {int length = strlen (STR); int I = 0, j = 0; // [I, j) is always uppercase (; j <length; j ++) {If (STR [J]> = 'A' & STR [J] <= 'Z ') // lower case {swap (STR [I], STR [J]); I ++ ;}}// the second version of the segment, higher time efficiency void proc1 (char * Str) {int length = strlen (STR); int I = 0, j = length-1; // [0, I) lower case, (J, length-1] uppercase while (1) {While (I <J & STR [I] <= 'Z' & STR [I]> = 'A') ++ I; while (j> I & STR [J]> = 'A' & STR [J] <= 'Z') -- J; if (I <j) {swap (STR [I ++], STR [j --]);} elsebreak;} void testofproc () {char STR [] = "asdfdfadafsdf "; proc (STR); cout <STR <Endl; char str1 [] = "asdfdfadafsdf"; proc1 (str1); cout <str1 <Endl ;}