Problem link: http://projecteuler.net/problem=20
For example, ,
and the sum of the digits in the number 10! is .
Find the sum of the digits in the number 100!
[TopCoder, ProjectEuler, HackerRank, CodeChef, CodeForces, InterviewSites]
[The problem appeared in TopCoder SRM 279 (Div-2, Level-1) and SRM 279 (Div-1, Level-1)]
A sentence is called dancing if its first letter is uppercase and the case of each subsequent letter is the opposite of the previous letter. Spaces should be ignored when determining the case of a letter. For example, “A b Cd” is a dancing sentence because the first letter (‘A’) is uppercase, the next letter (‘b’) is lowercase, the next letter (‘C’) is uppercase, and the next letter (‘d’) is lowercase.
You will be given a String sentence. Turn the sentence into a dancing sentence by changing the cases of the letters where necessary. All spaces in the original sentence must be preserved.