hiho week 259 register

Ended

Participants:95

Verdict:Accepted
Score:100 / 100
Submitted:2019-06-16 16:01:09

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include<bits/stdc++.h>
int main()
{
    int N,i,j,l;
    char s[110],t[110];
    while(scanf("%d",&N)!=EOF){
        for(;N>0;N--){
            scanf("%s",&s);
            l=strlen(s); 
            for(i=j=0;i<l;i++){
                if(s[i]=='_'){
                    t[j++]=s[++i]-'a'+'A';
                }else if(s[i]>='A' && s[i]<='Z'){
                    t[j++]='_';
                    t[j++]=s[i]-'A'+'a';
                }else t[j++]=s[i];
            }
            t[j]=0;
            printf("%s\n",t);
        }
    }
    return 0;
} 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX