[Offer收割]编程练习赛104 register

Ended

Participants:85

Verdict:Accepted
Score:100 / 100
Submitted:2019-07-21 12:09:50

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
27
28
29
30
31
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
char s[100010];
int main(){
    cin>>s;
    int len=strlen(s);
    int k=0;
    while(k<len){
        if(s[k]=='0'){
            cout<<"C";
            k++;
        }
        else if(s[k]=='1'){
            if(s[k+1]=='1'){
                cout<<"B";
                k+=2;
            }
            else if(s[k+1]=='0'){
                if(s[k+2]=='1'){
                    cout<<"A";
                    k+=3;
                }
                else if(s[k+2]=='0'){
                    cout<<"D";
                    k+=3;
                }
            }
        }
    }
    return 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX