hiho week 259 register

Ended

Participants:95

Verdict:Accepted
Score:100 / 100
Submitted:2019-06-18 10:16:47

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
24
25
26
#include<bits/stdc++.h>
int main(){
    int T;
    std::cin >> T;
    while(T--){
        std::string s;
        std::cin >> s;
        std::string ans;
        for(int i = 0; i < s.size(); i++){
            if(s[i] == '_'){
                ans+= s[i+1]-32;
                i +=1;
                continue;
            }
            if(s[i]>='A'&&s[i]<='Z'){
                ans+= '_';
                ans+= s[i] + 32;
                continue;
            }
            ans += s[i];
        }
        std::cout << ans << std::endl;
    }
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX