7 条题解

  • 13
    @ 2023-7-26 15:28:45

    点个赞再走

    #include<iostream>
    using namespace std;
    int main(){
        int a;
        cin>>a;
        if(a>0) cout<<"positive";
        else if(a==0) cout<<"zero";
        else cout<<"negative";
        return 0;
    }
    
    
    • 5
      @ 2023-7-14 19:41:07

      这道题挺简单的,就是它的V太像U了

      #include<iostream>
      using namespace std;
      int main()
      {
          int q;
          cin>>q;
          if(q>0) cout<<"positive";
          else if(q==0) cout<<"zero";
          else cout<<"negative";
          return 0;
      }
      
      • 2
        @ 2024-1-20 15:12:49

        Python

        a = input()
        c = len(a)
        d = int(c)
        if d >= 0 and a[:1] != '-':
            if d == '0':
                print('zero')
            else:
                print('positive')
        else:
            print('negative')
        
        • 1
          @ 2023-6-19 23:04:58
          #include <iostream>
          using namespace std;
          
          int main() {
          	int n;
          	cin>>n;
          	if(n>0) {
          		cout<<"positive";
          	} else if(n==0) {
          		cout<<"zero";
          	} else {
          		cout<<"negative";
          	}
          	return 0;
          }
          
          • 1
            @ 2023-6-19 19:38:57
            #include<bits/stdc++.h>
            using namespace std;
            int main(){
                int n;
                cin >> n;
                if (n > 0)
                {
                    cout << "positive";
                }
                else if(n == 0)
                {
                    cout << "zero";
                }
                else{
                    cout << "negative";
                }
                return 0;
            }
            
            • 0
              @ 2024-5-26 16:39:43
              #include <bits/stdc++.h>
              using namespace std;
              int n;
              int main()
              {
                  cin >> n;
                  if (n > 0)
                      cout << "positive";
                  else if (n == 0)
                      cout << "zero";
                  else
                      cout << "negative";
                  return 0;
              }
              
              • 0
                @ 2024-4-20 21:09:46

                ```用三个if条件判断即可

                #include <iostream>
                using namespace std;
                int main()
                {
                int n;
                cin >> n;
                if (n > 0)
                cout << "positive";
                if (n == 0)
                cout << "zero";
                if (n < 0)
                cout << "negative";
                return 0;
                }
                
                
                
                • 1

                信息

                ID
                153
                时间
                1000ms
                内存
                128MiB
                难度
                8
                标签
                递交数
                10899
                已通过
                2082
                上传者