97 条题解

  • 135
    @ 2022-7-13 22:02:40
    #include <bits/stdc++.h> 
    using namespace std;
    int main()
    {
        int n;
        cin >> n;
        if(n % 2 == 0)//先判断是否为偶数,若是,继续判断是否为两位数。
        {
            if(n / 10 <= 9 and n / 10 >= 1)//判断是否为两位数,因为一个两位数,除以10后的商必在1~9之内,由此可以判断。
            {
                cout << "Yes" << endl;
            }
            else
            {
                cout << "No" << endl;
            }
        }
        else//若不是偶数,输出No
        {
            cout << "No" << endl;
        }
        return 0;
    }
    

    编码不易😕 ,点赞走起👀️ 记得点赞再抱走奥😄

    • 39
      @ 2022-8-4 19:08:19

      这题有一个很坑的地方,就是如果他如果n / 10是等于0那也要输出“No”,我的代码这么简洁,点个赞吧~谢谢啦各位程序猿们!

      ```
      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          int a;
          cin >> a;
          if ((a / 10) < 10 && a % 2 == 0 && a / 10 > 0)
              cout << "Yes";
          else
              cout << "No";
          return 0;
      }
      ```
      
      • @ 2022-8-5 9:53:07

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

        你看这样子更简洁,神奇的是,它也能AC

      • @ 2022-12-25 10:19:31

        我的代码才是最简洁的

        #include <iostream>
        int main()
        {
            std::cout << "No";
            return 0;
        }
        
      • @ 2023-8-1 21:35:25

        @ 9(六翻了)

      • @ 2023-8-4 16:37:34

        ???@[AKA奥利给 (hetao2909413) ]6666

      • @ 2023-8-4 20:25:27

        @6666666666

      • @ 2023-8-4 20:27:45

        @

        AKA奥利给 (hetao2909413) 6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666

      • @ 2023-8-10 12:32:39

        错的吧

      • @ 2023-8-13 9:59:58

        WC,真能AC

      • @ 2023-8-27 18:08:37

        @[hcx (entered) 不就是浓缩到一行了吗

      • @ 2023-8-28 10:43:12

        @ 亲测有效,不知道啥原理(9

      • @ 2023-10-5 20:36:41

        6逼,你真厉害啊,作者都怕你。(别揍我image

    • 29
      @ 2022-9-4 19:42:50

      这道题非常的简单。 你只需要:

      • 定义变量
      • 判断变量(两位数?偶数?)
      • 输出结果

      话不多说,上代码!

      #include<iostream>
      using namespace std;
      int main()
      {
          int x;
          string y = "No";
          cin >> x;
          if ((x % 2 == 0) and ((x >= 10) and (x < 99))) y = "Yes";
          cout << y << endl;
          return 0; 
      }               //    制作不易,给个免费的赞再复制行不行啊qwq*
      

      小盆友们,您学会了吗?

      • @ 2023-2-3 9:49:42

        问:用bool不香吗

        bool y = 0;
        
      • @ 2023-8-27 18:12:14

        C++里好像没有and和or只有&&和||这两个逻辑运算符

      • @ 2024-2-6 12:28:55

        @ c++ 里有and和or

    • 7
      @ 2023-8-17 17:59:46

      不会吧,这么简单 应该都会吧......(先 后看!养成习惯!)

      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          int n;
          cin>>n;
          if(n/2==0)//判断是不是偶数
          {
              if(n/10<=9&&n/10>=1)//判断是不是两位数
              {
                  cout<<"Yes";
              }
          }
          else//其他
          {
              cout<<"No";
          }
          return 0;
      }
      

      制作不易,给个赞吧,球球了...... 有什么问题,联系我,邮箱是ASheepBoy_Bed@163.com

      • @ 2024-2-5 13:39:56

        第七行有点问题:应该是n%2==0😄

    • 3
      @ 2023-9-3 18:51:09
      #include<iostream>
      using namespace std;
      int main()
      {
          int n;
          cin >> n;
          if (n % 2 == 0 and n <= 99 and n >= 10)
          {
              cout << "Yes";
          }
          else
          {
              cout << "No";
          }
          return 0;
      }
      
      
      
      
      • @ 2024-5-4 19:37:09

        #include<iostream> ^这里应该要空格吧

    • 3
      @ 2023-7-24 16:57:06

      简单if判断,上代码

      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	int n;cin>>n; //输入变量n
      	if(n<=99&&n>=10){ //判断是不是一个两位数					  
      		if(n%2==0){ //如果是,判断是不是偶数 
      			cout<<"Yes"; //是输出Yes 
      		}else{
      			cout<<"No"; //不是输出No 
      		}
      	}else{  
      		cout<<"No"; //如果不是两位数直接输出No
      	} 
      	return 0;
      }
      

      编码不易,记得点赞再抱走OK?😄

      • 2
        @ 2024-1-25 21:52:55

        我是做公益的,不求赞 直接上代码😄

        #include <bits/stdc++.h> 
        using namespace std;
        int n;
        int s(int x)//定义一个用来计算数位的函数
        {
            int y;
            while(x>0)
            {
                y++;
                x/=10;
            }
            return y;
        }
        int main()
        {
            cin>>n;//输入一个整数n
            if(s(n)==2&&n%2==0)//是否是两位的偶数
            {//如果是
                cout<<"Yes";//输出"Yes"
            }
            else//如果不是
            {
                cout<<"No";//输出"No"
            }
            return 0;
        }
        

        测试可通过 image

        • 2
          @ 2023-8-31 16:11:01
          #include<iostream>
          using namespace std;
          int main()
          {
              int n;
              cin>>n;
              if (n%2==0 and n<=99 and n>=10)
              {
                  cout<<"Yes";
              }
              else
              {
                  cout<<"No";
              }
              return 0;
          }
          
          • 1
            @ 2024-3-9 20:52:21
            #include <bits/stdc++.h>
            using namespace std;
            int main()
            {
                int n;
                cin >> n;
                if (n % 2 == 0)//判断是不是偶数
                {
                    if (n >= 10 && n <= 99)//判断n是不是两位数
                    {
                        cout << "Yes";
                    }
                    else
                    {
                        cout << "No";
                    }
                    
                }
                else
                {
                    cout << "No";
                }
                return 0;
            }
            
            • 1
              @ 2024-2-17 17:48:16
              #include <iostream>
              using namespace std;
              int main()
              {
                  int x;
                  cin>>x;
                  if(x>=10 and x<100)
                  {
                      if(x%2==0)
                      {
                          cout<<"Yes";
                      }
                      else
                      {
                          cout<<"No";
                      }
                  }
                  else
                  {
                      cout<<"No";
                  }
                  return 0;
              }
              
              • 1
                @ 2023-11-27 21:27:40

                上代码!!!

                #include <bits/stdc++.h>
                using namespace std;
                int main()
                {
                    int n;
                    cin >> n;
                    if(n % 2 == 0 and n / 2 >= 10 and n / 2 < 50)
                    {
                        cout <<"Yes";
                    }
                    else
                    {
                        cout <<"No";
                    }
                }
                
                • 1
                  @ 2022-8-5 17:43:42

                  极简写法

                  #include<bits/stdc++.h>
                  using namespace std;
                  int n;
                  int main(){
                      cin>>n;
                      n>=10&&n<100&&!n%2?cout<<"Yes":cout<<"No";
                      return 0;
                  }
                  
                  • 0
                    @ 2024-6-10 8:32:04

                    這裡需要用到嵌套的if else判斷。

                    #include<bits/stdc++.h>
                    using namespace std;
                    int main()
                    {
                        int n;
                        cin>>n;
                        if(n%2==1)//判斷n是否為偶數
                        {
                            cout<<"No";
                        }
                        else//如果n是偶數
                        {
                            if(n/10<10&&n/10>=1)//判斷n是否是兩位數(n除以10的結果應為1<=n/10<10)
                            {
                                cout<<"Yes";
                            }
                            else
                            {
                                cout<<"No";
                            }
                        }
                    return 0;
                    }
                    
                    • 0
                      @ 2024-5-15 10:55:01

                      #include <iostream> using namespace std; int main() { int n; cin>>n; if(n<100 and n>9) { if(n%2==0) { cout<<"Yes"; } else { cout<<"No"; } } else { cout<<"No"; } return 0; }

                      • 0
                        @ 2024-4-27 21:35:04
                        1. *这道题最简单的题解:
                            1. #include<iostream> using namespace std; int main() { std:cout << "No"; return 0; }
                        • 0
                          @ 2024-1-29 22:31:48

                          点个赞吧

                          #include <bits/stdc++.h> 
                          using namespace std;
                          int main()
                          {
                              int n;
                              cin >> n;
                              if(n % 2 == 0)//先判断是否为偶数,若是,继续判断是否为两位数。
                              {
                                  if(n / 10 <= 9 and n / 10 >= 1)//判断是否为两位数,因为一个两位数,除以10后的商必在1~9之内。
                                  {
                                      cout << "Yes" << endl;
                                  }
                                  else
                                  {
                                      cout << "No" << endl;
                                  }
                              }
                              else//若不是偶数,输出No
                              {
                                  cout << "No" << endl;
                              }
                              return 0;
                          }
                          
                          • 0
                            @ 2024-1-3 21:15:16
                            #include <iostream>
                            using namespace std;
                            int main()
                            {
                                int n;
                                cin >> n;
                                if (n % 2 == 0)
                                {
                                    if (n / 10 < 10 and n / 10 > 0)
                                    {
                                        cout << "Yes" << endl;
                                    }
                                    else
                                    {
                                        cout << "No" << endl;
                                    }
                                }
                                else
                                {
                                    cout << "No" << endl;
                                }
                                return 0;
                            }
                            
                            • 0
                              @ 2023-12-30 18:34:34
                              #include <iostream>
                              using namespace std;
                              int main()
                              {
                                  int n;
                                  cin >> n;
                                  // return 0 就是终止程序
                                  if (n<9 || n>100){
                                      cout << "No";
                                      return 0;
                                  }
                              
                                  if (n % 2 == 0)
                                  {
                                      cout << "Yes";
                                      return 0;
                                  }
                              
                                  cout << "No";
                              }
                              
                              • 0
                                @ 2023-11-27 11:51:19
                                #include <iostream>
                                using namespace std;
                                int main()
                                {
                                    int n;
                                    cin>>n;
                                    if (n%2==0) // 判断是否为偶数
                                    {
                                        if ((n / 10) >= 1 && (n / 100) < 1) // 两位数÷10所得的商大于等于1,两位数÷100所得的商小于1
                                        {
                                            cout<<"Yes";
                                        }
                                        else
                                        {
                                            cout<<"No";
                                        }
                                    }
                                    else
                                    {
                                        cout<<"No";
                                    }
                                    return 0;
                                }
                                
                                • 0
                                  @ 2023-11-25 22:01:51
                                  #include<bits/stdc++.h>
                                  using namespace std;
                                  int main()
                                  {
                                      int n;
                                      cin>>n;
                                      if(n%2==0)
                                      {
                                          if((n>=10)and(n<100))
                                          {
                                              cout<<"Yes";
                                          }
                                          else
                                          {
                                              cout<<"No";
                                          }
                                      }
                                      else
                                      {
                                          cout<<"No";
                                      }
                                  }
                                  

                                  信息

                                  ID
                                  653
                                  时间
                                  1000ms
                                  内存
                                  16MiB
                                  难度
                                  6
                                  标签
                                  递交数
                                  11816
                                  已通过
                                  3656
                                  上传者