4 条题解

  • -1
    @ 2024-6-21 9:49:08

    都乱写呗

    Python

    print(sum(i for i in map(int, input().split()) if i < 0))
    
    • -1
      @ 2023-10-18 9:37:15
      a=map(str,input().split())
      b=0
      for i in a:
          if i[0]=='-':
              b+=int(i[1:len(i)])
      print('-'+str(b))
      
      • -1
        @ 2023-7-17 7:50:51
        #include <iostream>
        
        using namespace std;
        int a[110],n=1,m=0;
        int main()
        {
            while (cin>>a[n]){
                n++;
            }
            for (int i=1;i<=n;i++){
                if(a[i]<0){
                        m+=a[i];
                }
            }
            cout<<m;
            return 0;
        }
        

        c++

        • -2
          @ 2025-2-28 12:31:25
          a=map(str,input().split())
          b=0
          for i in a:
              if i[0]=='-':
                  b+=int(i[1:len(i)])
          print('-'+str(b))
          
          • 1

          信息

          ID
          55
          时间
          1000ms
          内存
          128MiB
          难度
          3
          标签
          递交数
          564
          已通过
          320
          上传者