求救系列帖子(数的性质)
查看原帖
求救系列帖子(数的性质)
1025203
yahu2023楼主2024/10/26 16:55

“一看就会,一做就废”代码求救系列

这里是“数的性质”题目求救

咋才六十分????

代码如下:

#include <iostream>
using namespace std;
int main(){
	int x,uim,b,sister,a;
	cin >> x;
	if ((x % 2 == 0) && (x > 4 && x <= 12)){
		a = 1;
	}
	else{
		a = 0;
	}
	
	if ((x % 2 == 0) || (x > 4 && x <= 12)){
		uim = 1;
	}
	else{
		uim = 0;
	}
	
	if (((x % 2 == 0) || (x > 4 && x <= 12)) && (!((x % 2 == 0) && (x > 4 && x <= 12)))){
		b = 1;
	}
	else{
		b = 0;
	}
	
	if (!(x % 2 == 0) && (x > 4 && x <= 12)){
		sister = 1;
	}
	else{
		sister = 0;
	}
	cout << a << " "<< uim << " "<< b << " "<< sister;
	return 0;
}

请大佬说明问题

这道题对我四年级小学生来说也不难啊啊啊!!!

2024/10/26 16:55
加载中...