首字母大写 题解:
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
while(getline(cin,s)){
int flag=1;
for(char c:s){
if(flag==1)
c=toupper(c);
cout<<c;
if(c==' '||c=='\t'||c=='\r'||c=='\n')
flag=1;
else
flag=0;
}
cout<<endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发