最笨的解决方法:枚举

maplesky  •  1年前


#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	if(a==0&b==0&c==0&d==0)
		cout<<"0"<<endl;
	if(a==1&b==1&c==1&d==1)
		cout<<"0"<<endl;
	if(a==0&b==0&c==0&d==1)
		cout<<"1"<<endl;
	if(a==0&b==0&c==1&d==0)
		cout<<"1"<<endl;
	if(a==0&b==1&c==0&d==0)
		cout<<"1"<<endl;
	if(a==1&b==0&c==0&d==0)
		cout<<"1"<<endl;
	if(a==1&b==1&c==1&d==0)
		cout<<"1"<<endl;
	if(a==1&b==1&c==0&d==1)
		cout<<"1"<<endl;
	if(a==1&b==0&c==1&d==1)
		cout<<"1"<<endl;
	if(a==0&b==1&c==1&d==1)
		cout<<"1"<<endl;
	if(a==1&b==1&c==0&d==0)
		cout<<"2"<<endl;
	if(a==1&b==0&c==1&d==0)
		cout<<"2"<<endl;
	if(a==1&b==0&c==0&d==1)
		cout<<"2"<<endl;
	if(a==0&b==1&c==0&d==1)
		cout<<"2"<<endl;
	if(a==0&b==1&c==1&d==0)
		cout<<"2"<<endl;
	if(a==0&b==0&c==1&d==1)
		cout<<"2"<<endl;
	return 0;
}

评论:

其实这是打表(


seanlsy  •  1年前

ctrl+a+c+v yyds  •  8个月前

6


ctrl+a+c+v yyds  •  8个月前

6,简单但没完全简单


啊?  •  7个月前

zha2023是个shuai ge


shoupolan  •  7个月前