请帮我Debug

P4414 [COCI2006-2007#2] ABC

LVruigege496 @ 2024-10-22 16:53:19

#include<cstdio>
#include<cstring>
#include<queue>
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
string abc;
char zfsz[3];
int sz[3];
int main()
{
    cin>>a>>b>>c;
    cin>>abc;
    for(int i=0;i<3;i++){
        abc[i] = zfsz[i];
    }
    sz[0] = min(min(a,b),c);
    sz[2] = max(max(a,b),c);
    if(sz[2] == a){
        if(sz[0] == b){
            sz[1] = c;
        }
        else sz[1] = b;
    }
    else if(sz[2] == b){
        if(sz[0] == a){
            sz[1] = c;
        }
        else sz[1] = a;
    }
    else
    {
        if(sz[0] == c){
            sz[1] = a;
        }   
        else sz[1] = b;
    }
    for(int i=0;i<3;i++){
        if(zfsz[i] == 'A'){
            cout<<sz[0]<<' ';
        }
        else if(zfsz[i] == 'B'){
            cout<<sz[1]<<' ';
        }
        else cout<<sz[2]<<' ';
    }

    return 0;   
}

by zhao_sd @ 2024-10-22 17:11:45

你这个代码太复杂了


by zhao_sd @ 2024-10-22 17:17:33

楼主在线吗?


by zhao_sd @ 2024-10-22 17:19:30

@LVruigege496

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a[10001];
    cin>>a[1]>>a[2]>>a[3];
    char A,b,c;
    cin>>A>>b>>c;
    sort(a+1,a+4);
    cout<<a[int(A-'A'+1)]<<" "<<a[int(b-'A'+1)]<<" "<<a[int(c-'A'+1)];
} 

by zhao_sd @ 2024-10-22 17:20:20

这是我的想法,你可以参考一下,有个小要求行吗,QWQ,能关注一下这个账号吗@zhao__sd


by LVruigege496 @ 2024-10-23 12:21:39

@zhao_sd 我在,谢谢,已关。


by LVruigege496 @ 2024-10-23 12:22:39

@zhao_sd 你怎么被封禁了?


by zhao_sd @ 2024-10-23 17:07:21

@LVruigege496 我用的这个头像而已而且你关注错了,你关注的是我的小号,能关注这个号吗(@zhao__sd)


|