谁能帮孩子看看,想AC,但只有20分,谢谢大家QAQ
查看原帖
谁能帮孩子看看,想AC,但只有20分,谢谢大家QAQ
930426
aha1000楼主2023/1/28 19:22
#include<iostream>
using namespace std;
bool term1,term2;
int x;
int main()
{
    cin >> x;
    if(x / 2 == 0)
    {
        term1 == 1;
    }
    
    if(x > 4 && x < 12)
    {
        term2 == 1;
    }
    
     if(term1 == 1 && term2 == 1)
     {
         cout << 1 << " ";
     }
     else
     {
        cout << 0 << " ";
     }
      if((term1 == 1 && term2 == 1) || (term1 == 0 && term2 == 1) ||(term1 == 1 && term2 == 0))
      {
          cout << 1 << " ";
      }
      else
      {
         cout << 0 << " ";
      }
       if((term1 == 0 && term2 == 1) || (term1 == 1 && term2 == 0))
       {
           cout << 1 << " ";
       }
       else
       {
          cout << 0 << " ";
       }
    if(term1 == 0 && term2 == 0) 
    {
        cout << 1 << " ";
    }
    else
    {
        cout << 0 << " ";
    }
    return 0;
}
2023/1/28 19:22
加载中...