11 条题解

  • 2

    思路

    a&1 可以保留 aa 二进制下的最后一位,从而判断奇偶性。

    code

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
       int a;
       cin>>a;
       if(a&1)  cout<<"NO";
       else  cout<<"YES";
       return 0;
    }
    
    • 1
      @ 2024-11-8 13:27:30

      #include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; if(a%2==0) { cout<<"YES"; } else { cout<<"NO"; } return 0; }

      • 1
        @ 2024-11-8 13:17:17

        #include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; if(a%2==0) { cout<<"YES"<<endl; } else { cout<<"NO"<<endl; } return 0; }

        • 1
          @ 2023-12-25 13:36:52

          #include<iostream> using namespace std; int main() { int a,b; cin>>a; b=a%2; if(b==0) { cout<<"YES"<<endl; } else { cout<<"NO"<<endl; } return 0; }

          • 1
            @ 2023-12-25 13:13:34

            #include<iostream> using namespace std; int main() { int a; cin>>a; if(a%2==0) { cout<<"YES"<<endl; } else { cout<<"NO"<<endl; } return 0; }

            • 1
              @ 2023-12-25 13:09:33

              #include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; if(a%2==0) { cout<<"YES"; } else { cout<<"NO"; } return 0 ; }

              • 1
                @ 2023-12-24 17:45:44

                ==表判断左右是否相等,=表赋值

                • 1
                  @ 2023-12-24 13:51:34

                  #include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; if(a % 2==0) { cout<<"YES"; } else { cout<<"NO"; } return 0; }

                  • 0
                    @ 2024-11-10 13:26:06

                    #include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; if(a%2==0) {cout<<"YES";} else{cout<<"NO";} return 0; }

                    • 0
                      @ 2024-11-4 13:53:50

                      YYDS

                      • 0
                        @ 2024-1-2 13:57:56

                        #include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; if(n%2==0) { cout<<"Yes"; } else { cout<<"No"; } return 0; }

                        • 1

                        信息

                        ID
                        22
                        时间
                        1000ms
                        内存
                        256MiB
                        难度
                        3
                        标签
                        递交数
                        222
                        已通过
                        122
                        上传者