April Fools Contest 2017 E

Description

Input

The input consists of four lines, each line containing a single digit 0 or 1.

Output

Output a single digit, 0 or 1.

Example
input
0
1
1
0
output
0

一个数字电路,不过或门和异或门是反的,所以。。注意下
#include<bits/stdc++.h>
using namespace std;
#define ll long long
string s;
int a,b,c,d;
int main()
{
    cin>>a>>b>>c>>d;
    printf("%d\n",((a^b)&(c|d))^((b&c)|(a^d)));
    return 0;
}

 

 

 

posted @ 2017-04-02 21:03  樱花落舞  阅读(129)  评论(0编辑  收藏  举报