Bessie has been programming in Java lately and has been contemplating variable names known as "camel case" variables. You might have seen these; each one contains several regular words but words after the first one are capitalized. Thus, a variable that contains the "number of cows" is written "numberOfCows". As usual, Bessie's mind is wandering. 'What would the variables look like as each capital letter is removed?' she wondered. Write a program that reads in a single "camel case" word (2
Bessie has been programming in Java lately and has been contemplating variable names known as "camel case" variables. You might have seen these; each one contains several regular words but words after the first one are capitalized. Thus, a variable that contains the "number of cows" is written "numberOfCows". As usual, Bessie's mind is wandering. 'What would the variables look like as each capital letter is removed?' she wondered. Write a program that reads in a single "camel case" word (2 <= length <= 80) and successively removes the capitalized variable that appears latest in normal english alphabetical order. It is promised that all capital letters are unique within a given variable name and that at least one capital letter iexsts. Here's an example that shows the stages of transforming the variable 'theRainInSpainFallsMainlyOnThePlain': theRainInSpainFallsMainlyOnhePlain <-- remove T theRainInpainFallsMainlyOnhePlain <-- remove S theainInpainFallsMainlyOnhePlain <-- remove R theainInpainFallsMainlyOnhelain <-- remove P theainInpainFallsMainlynhelain <-- remove O theainInpainFallsainlynhelain <-- remove M theainnpainFallsainlynhelain <-- remove I theainnpainallsainlynhelain <-- remove F
标签: HBC25072HelloWorld[USACO 2007 Ope l]Camel Case Variables题解