2 条题解

  • 1
    @ 2025-2-15 4:59:14

    不喜欢if-else的有福了(bushi)

    #include <bits/stdc++.h>
    
    int main(){
        int a, b;
        scanf("%d", &a);
        b = !(a % 2) + (a > 4 && a <= 12);
        printf("%d %d %d %d", b == 2, !!b, b == 1, !b);
    }
    
    • 1

      #include<bits/stdc++.h> using namespace std; int main() { int x; cin>>x; if(x%20 && (x>4 && x<=12)) { cout<<1<<" "; } else { cout<<0<<" "; } if(x%20 || (x>4 && x<=12)) { cout<<1<<" "; } else { cout<<0<<" "; } if((x%2==0 && (x<=4 || x>12)) || (x%2!=0 && (x>4 && x<=12))) { cout<<1<<" "; } else { cout<<0<<" "; } if(x%2!=0 && (x<=4 || x>12)) { cout<<1<<" "; } else { cout<<0<<" "; } return 0; }

      • 1

      信息

      ID
      9732
      时间
      1000ms
      内存
      125MiB
      难度
      1
      标签
      (无)
      递交数
      39
      已通过
      26
      上传者