HBC25072HelloWorld[USACO 2007 Ope l]Camel Case Variables题解

一沫阳光 算法基础篇 52 0
题库丰富多样,涵盖各个领域,全网最全C++题库,让您在练习中不断成长!
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题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
成为编程大师,不再是梦想!全网最全C++题库,助您开启编程新篇章。

标签: HBC25072HelloWorld[USACO 2007 Ope l]Camel Case Variables题解