标签:
1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 int main() 6 { 7 char s[105]; 8 while(gets(s)) 9 { 10 int len = strlen(s); 11 printf("%c", s[0]-32); //小写字母的ASCII比对应的大写字母大32 12 for(int i = 1; i < len; i++) 13 { 14 if(s[i-1] == ‘ ‘) printf("%c", s[i]-32); 15 else printf("%c", s[i]); 16 } 17 printf("\n"); 18 } 19 return 0; 20 }
标签:
原文地址:http://www.cnblogs.com/loveprincess/p/4818082.html