#import <Foundation/Foundation.h> int main(int argc, const char * argv[]) {
@autoreleasepool {
char c[100]=""; scanf("%s",c); printf("%s\n",c);
if (c[0]>='a'&&c[0]<='z') { c[0]=c[0]-32; }
int i = 0; while (c!='\0') { if (c==' ') { if (c[i+1]>='a'&&c[i+1]<='z') { c[i+1]=c[i+1]-32; } } printf("%c",c); i++; }
} return 0; } 直接写字符串可以实现 但是从键盘输入就不行了
|