比赛 2026初中综合小练习 评测结果 AAWWWWWWWWWWWWWWWWWW
题目名称 逻辑表达式 最终得分 10
用户昵称 LHS28_ 运行时间 0.409 s
代码语言 C++ 内存使用 4.34 MiB
提交时间 2026-04-14 21:02:43
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;

string s;

int main(){
    freopen("expr.in","r",stdin);
    freopen("expr.out","w",stdout);
    cin>>s;
    if (s.size() == 3){
        if (s[1] == '&'){
            if (s[0] == '0' || s[2] == '0') cout<<0<<'\n'<<1<<' '<<0;
            else cout<<1<<'\n'<<0<<' '<<0;
        }else if (s[1] == '|'){
            if (s[0] == '1' || s[2] == '1') cout<<1<<'\n'<<0<<' '<<1;
            else cout<<0<<'\n'<<0<<' '<<0; 
        }else cout<<s[1]<<' '<<0<<' '<<0;
    }
    return 0;
}