Uppercase letters
Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)
Total submission (s): 30463 accepted submission (s): 17060
Problem description: enter an English sentence and change the first letter of each word to an uppercase letter.
The input data contains multiple test instances. Each test instance is an English sentence of no more than 100 characters, occupying one line.
Output: output the English sentence after Rewriting as required.
Sample Input
i like acmi want to get an accepted
Sample output
I Like AcmI Want To Get An Accepted
Authorlcy
Sourcec language programming exercises (4)
Recommendlcy | we have carefully selected several similar problems for you: 2027 2043 2031 2030
Statistic | submit | discuss | note
Question, AC code:
#include <iostream>using namespace std;int main(){char a[105];while (gets(a)){a[0] = a[0] - 32;for (int i = 1; i < strlen(a);i++)if (a[i - 1] == ' ')a[i] -= 32;cout << a << endl;}return 0;}
Hdoj 2026 uppercase letters