3 条题解

  • 3
    @ 2024-10-23 21:30:10

    为什么没人写

    正数大于0 负数小于零

    直接判断就行

    AC code

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n;
        cin>>n;
        if(n>0) cout<<"yes";
        else if(n<0) cout<<"no";
        else cout<<0;
        return 0;
    }
    
    
    • 2
      @ 2024-10-24 15:57:11

      思路

      正数大于0 负数小于0 0=0

      题解

      #include <iostream>
      #include <cstdio>
      using namespace std;
      int main()
      {
          int i;
          cin>>i;
          if(i>0){
              cout<<"yes";
          }
          else if(i==0){
              cout<<"0";
          }
          else if(i<0){
              cout<<"no";
          }
          return 0;
      }
      
      
      • 1
        @ 2025-8-9 19:44:37
        #include <iostream>
        #include <cstdio>
        using namespace std;
        int main()
        {
            int a;
            cin>>a;
            if(a>0)
            {
                cout<<"yes";
            }
            if(a==0)
            {
                cout<<0;
            }
            if(a<0)
            {
                cout<<"no";
            }
            return 0;
        }
        
        
        • 1

        信息

        ID
        40
        时间
        1000ms
        内存
        256MiB
        难度
        1
        标签
        递交数
        99
        已通过
        45
        上传者