40分求助!!
查看原帖
40分求助!!
1066064
zfy2013楼主2023/9/1 15:30

各位dalao,求助这题!!

#include<iostream>
using namespace std;

int main(){
	int n;
	cin >> n;
	bool flag1 = false,flag2 = false;
	if (n % 2 == 0){
		flag1 = true;
	}
	if (n > 4 and n >= 12){
		flag2 = true;
	}
	if (flag1 and flag2){
		cout << 1 << " ";
	}
	else{
		cout << 0 << " ";
	}
	if (flag1 or flag2){
		cout << 1 << " ";
	}
	else{
		cout << 0 << " ";
	}
	if (flag1 and !flag2 or !flag1 and flag2){
		cout << 1 << " ";
	}
	else{
		cout << 0 << " ";
	}
	if (!flag1 and !flag2){
		cout << 1 << " "; 
	}
	else{
		cout << 0 << " ";
	}
	return 0;
}
2023/9/1 15:30
加载中...