2 条题解

  • 1
    @ 2026-6-6 22:03:26
    #include <bits/stdc++.h>
    using namespace std;
    int main() {
    long long x,y;
    cin>>x>>y;
    if(x>0){
    y=x+1;
    cout<<y;
    }
    if(x=0){
    y=0;
    cout<<y;
    }
    if(x<0){
    y=x-1;
    cout<<y;
    }
        return 0;
    }
        
    
    
    • 0
      @ 2026-6-6 16:08:46
      #include <bits/stdc++.h>
      using namespace std;
      
      int main()
      {
          int x, y;
          cin >> x;
          if (x > 0)
              y = x + 1;
          else if (x == 0)
              y = 0;
          else
              y = x - 1;
          cout << y << endl;
          return 0;
      }
      
      • 1

      【入门】编程求解数学中的分段函数

      信息

      ID
      30043
      时间
      1000ms
      内存
      256MiB
      难度
      3
      标签
      递交数
      57
      已通过
      29
      上传者