3 条题解

  • -1
    @ 2026-5-31 17:35:30

    #include <bits/stdc++.h> using namespace std;

    //main int main() { int a, b, c; cin >> a >> b >> c; if (a == b - 1 || c == b + 1) { cout << "TRUE" << endl; } else { cout << "FALSE" << endl; }

    return 0;
    

    } 为什么这个只得80分?

    • @ 2026-6-11 22:19:57
      #include<bits/stdc++.h> 
      using namespace std;
      int main() {
      long long a,b,c,a1,b1,c1;
      cin>>a>>b>>c;
      a1=max(a,max(c,b));
      b1=min(a,min(b,c));
      c1=a+b+c-a1-b1;
      if(c1+1==a1&&c1-1==b1){
      cout<<"TRUE";
      }
      else{
      cout<<"FALSE";
      }
              return 0;
          }
               
      
      

【入门】判断三个整数是否相邻

信息

ID
30046
时间
1000ms
内存
256MiB
难度
5
标签
递交数
81
已通过
29
上传者