文章
28
粉丝
226
获赞
53
访问
144.4k
#include <iostream>
using namespace std;
int main()
{
string str;
while(getline(cin, str)){
for(int i = 0;i < str.size();i++){
if(i == 0){
if('a' <= str[i] && str[i] <= 'z'){
str[i] = str[i] - 32;
}
}else if((str[i-1] == ' ' || str[i-1] == '\t' || str[i-1] == '\r' || str[i-1] == '\n') && 'a' <= str[i] && str[i] <= 'z'){
str[i] = str[i] - 32;
}
}
cout << str << endl;
&nbs...
登录后发布评论
暂无评论,来抢沙发