Use the while loop or a for loop to input text every two words each word is capitalized:
Such as input: hello there, to make the result to hello there.
CodePudding user response:
Get an integer variables, the initial value is 0, then compares the variables and the length of the string value and enter the while loop,In each cycle, with the variable as a string of subscript indices for each character, at the same time, according to the variable current is even or odd number to case character conversion, final reoccupy Append splicing, increasing variable 1 at the same time, into the next cycle,