全部评论 8

  • 如果需要详细讲解请联系我

    2024-08-02 来自 浙江

    0
  • 具体的代码给你

    #include <iostream>
    using namespace std;
    bool daan(int n){
        if(n >= 10 && n < 100)
            return true;
        return false;
    }
    int main(){
        int n;
        cin >> n;
        if(daan(n))
            cout << "1";
        else
            cout << "0";
        return 0;
    }
    

    当然,这个只是我的代码,不一定为标准答案哦

    2024-08-02 来自 浙江

    0
  • 用string会不会更快点a

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	string a;
    	cin>>a;
    	cout<<(a.size()==2);
    }
    

    2024-08-02 来自 浙江

    0
  • 不要是小于等于100和小于等于9,这里可以调成 —— >100 && < 9 即可,也可以是(n >= 10 && n < 100)

    2024-08-02 来自 浙江

    0
  • 这样不就够了?
    cout<<(int)((a>=10)&&(a<=99));

    2024-07-27 来自 广东

    0
  • cout << (n > 9 and n < 100 ? 0 : 1);三目运算符至高无上

    2024-03-17 来自 上海

    0
  • 呃,不需要"return 0;"吗

    2023-07-21 来自 广东

    0
    • userId_undefined

      Pai

      回复G-Z-R?

      不一定需要

      2023-07-21 来自 广东

      0
    • userId_undefined

      Pai

      回复G-Z-R?

      最好是加上,这是个好习惯

      2023-07-21 来自 广东

      0
  • 发错了
    上面的是错误的版本
    #include<iostream>
    using namespace std;
    int main (){
    int n;
    cin>>n;
    if(n>=100||n<=9)cout<<0;
    else cout<<1;
    }

    2023-07-21 来自 广东

    0

热门讨论