#include <stdio.h> #include <string.h> int main(){ int i,len; char s[100]; while(gets(s)){ if(s[0]>='a'&&s[0]<='z') s[0]-=32; len=strlen(s); for(i=1;i<len;i++){ if(s[i]==' '||s[i]=='\t'||s[i]=='\r'||s[i]=='\n'){ if(s[i+1]>='a'&&s[i+1]<='z') s[i+1]-=32; } } printf("%s\n",s); } }这里,大写字母与小写字母的字符值相差32 (•̀ᴗ•́)و