1 solutions

  • 0
    @ 2025-3-3 16:34:00

    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

    Information

    ID
    10889
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By