Home > Back-end >  c
c

Time:10-11

Write a word conversion function, the function with a char * parameters, implementation will be the first letter of each word in a given string is converted to capital, in the main function of the input and output of the converted string,
For example:
The input string: There are 100 students in the room.
Output The converted string: There Are 100 Student In The Room.

1) programming thoughtU use gets () or cin. Getline () input string containing Spaces,
U set a character variable for the current character of precursor variable, when the current characters to lowercase letters and precursors for Spaces to transform, otherwise the cursor backwards and the current character set as precursor character, until the end of the string

CodePudding user response:

String according to the space in the array, traverse the judge first character to capital replacement back, print is ok