Twisted Circuit

题目描述

输入格式

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

输出格式

Output a single digit, 0 or 1.

题意翻译

读入四个整数 00 或者 11,作为如图所示的电路图的输入。请输出按照电路图运算后的结果。

感谢@PC_DOS 提供的翻译

输入输出样例

输入 #1复制

复制代码
0
1
1
0

输出 #1复制

复制代码
0
cpp 复制代码
#include <iostream>
using namespace std;
const int N = 1001;
int a[N][N];
long long n,ch[10001],sh[10001];
int main()
{
   	int ch[5];
   	for(int i=0;i<4;i++){
   		cin>>ch[i];	
	}
	cout<<(((ch[0]^ch[1])&(ch[2]|ch[3]))^((ch[1]&ch[2])|(ch[0]^ch[3])));
    return 0;
} 
相关推荐
草莓熊Lotso19 小时前
Qt 进阶核心:UI 开发 + 项目解析 + 内存管理实战(从 Hello World 到对象树)
运维·开发语言·c++·人工智能·qt·ui·智能手机
TonyLee0171 天前
LLVM安装(ubuntu22)
c++
Swift社区1 天前
LeetCode 465 最优账单平衡
算法·leetcode·职场和发展
聆风吟º1 天前
【数据结构手札】空间复杂度详解:概念 | 习题
java·数据结构·算法
weixin_445054721 天前
力扣热题51
c++·python·算法·leetcode
地平线开发者1 天前
linux 常见稳定性问题分析方法
算法·自动驾驶
s砚山s1 天前
代码随想录刷题——二叉树篇(九)
算法
地平线开发者1 天前
大模型常见量化方法简介
算法·自动驾驶
not coder1 天前
树形结构,从零到工业级评论系统
数据结构
smj2302_796826521 天前
解决leetcode第3801题合并有序列表的最小成本
数据结构·python·算法·leetcode