1 条题解

  • 0
    @ 2023-3-13 11:07:17

    C :

    #include<stdio.h>
    #include<stdlib.h>
    #include<string.h>
    #include<ctype.h>
    char s[1001],t[1],x[1001];
    int main()
    {
        gets(s);
        int len = strlen(s);
        int i;
        for(i=0;i<len;i++){
            if (i==0&&s[i]!=' '|| i>0 && s[i]!=' ' && s[i-1]==' ') {
                t[0]=toupper(s[i]);
                strcat(x, t);
            }
        }
        printf("%s",x);
        return 0;
    }
    
    

    Python :

    str = input();
    str = str.strip()
    li = str.split(" ");
    for s in li:
       if len(s) != 0:
        s = s[0].upper();
        print(s,end='')
    
    
    • 1

    信息

    ID
    1356
    时间
    1000ms
    内存
    16MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者