文章
150
粉丝
0
获赞
556
访问
23.0k
#include<bits/stdc++.h>
using namespace std;
int main(){
char str[105];
while(cin.getline(str, 105)){
int tag = 1;
int len = strlen(str);
for(int i=0;i<len;i++){
if(tag == 1 && !isspace(str[i])){
if( str[i] >= 'a' && str[i] <= 'z' )
str[i] = str[i] - 'a' + 'A'; //str[i] = toupper(str[i]);
tag = 0;
}
else if(isspace(str[i]))
tag = 1;
}
cout << str << endl;
}
return 0;
}
/*int main() {
char str[105];
while (cin.getline(str, 105)) {
int len = strlen(str);
bool newWord = true;
for (int i = 0; i < len; i++) {
if (newWord && !isspace(str[i])) {
if (islower(str[i])) {
str[i] = toupper(str[i]);
}
newWord = false;
} else if (isspace(str[i])) {
newWord = true;
}
}
cout << str << e...
登录后发布评论
暂无评论,来抢沙发