#include <stdio.h> #include <string.h> main() { char ch[100]; int i=0,n=0; gets(ch); while(ch[i]!='\0') { if(i==0) { if(ch[i]>='a'&& ch[i]<='z') ch[i]-=32; } else if(ch[i]==' '&& ch[i+1]!=' ') { if(ch[i+1]>='a'&& ch[i+1]<='z') ch[i+1]-=32; } i++; } puts(ch); getchar(); }
标签:ch,大写,C语言,首字母,&&,include From: https://www.cnblogs.com/xkdn/p/17067547.html