3 条题解

  • -2
    @ 2023-5-25 18:05:37
    #include <bits/stdc++.h>
    using namespace std;
    int n;
    int main()
    {
        cin >> n;
        if (n % 2 == 0)
        {
            cout << n + 1;
        }
        else
        {
            cout << n / 2 + 1;
        }
        return 0;
    }
    
    • -2
      @ 2023-4-10 20:49:11
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int n;
          cin>>n;
          if (n%2==0)
              cout<<n/2+n/2+1;//貌似可以直接n+1诶()
          else
              cout<<n/2+1;
          return 0;
      }
      • @ 2023-9-11 12:42:50

        是可以写成n+1 ,n的一半+n的一半=n O(∩_∩)O

    • -2
      @ 2023-1-17 9:02:59
      #include <iostream>//hetao3097453
      using namespace std;
      int main()
      {
          int n;
          cin >> n;
          if(n % 2 == 0)
          {
              cout << n + 1;
          }
          else
          {
              cout << n / 2 + 1;
          }
          return 0;
      }
      
      
    • 1

    信息

    ID
    876
    时间
    1000ms
    内存
    16MiB
    难度
    1
    标签
    递交数
    107
    已通过
    79
    上传者