求助各位师傅,编程语言为C++
查看原帖
求助各位师傅,编程语言为C++
1066942
DESKTOP303楼主2023/9/9 21:18

请问各位师傅,为什么这个答案不能通过第二个和第三个检测点?显示错误分别为

Wrong Answer.wrong answer On line 1 column 3, read 1, expected 0.

和

Wrong Answer.wrong answer On line 1 column 7, read 1, expected 0.
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main()
{
	int x;
	cin>>x;
	if (x%2==0&&4<=x<=12)
	 cout<<"1"<<" ";
	 else cout<<"0"<<" ";
	if (x%2==0||4<=x<=12)
	 cout<<"1"<<" ";
	 else cout<<"0"<<" ";
	if ((x%2==0||4<=x<=12)&&!(x%2==0&&4<=x<=12))
	 cout<<"1"<<" ";
	 else cout<<"0"<<" ";
	if (!(x%2==0&&4<=x<=12))
	 cout<<"1"<<" ";
	 else cout<<"0"<<" ";
	return 0;
}

WA声一片

2023/9/9 21:18
加载中...