5 条题解

  • 1
    @ 2023-3-7 13:07:04

    `` 挑战最短代码

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n;
        cin >> n;
        cout << n + n / 1000 + n / 100 % 10 + n / 10 % 10 + n % 10;
        return 0;
    }
    
    • 1
      @ 2022-12-13 16:54:42
      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
      	int n;
      	cin >> n;
      	int a = n / 1000;
      	int b = n / 100 % 10;
      	int c = n / 10 % 10;
      	int d = n % 10;
      	cout << n + a + b + c + d;
          return 0;
      }
      
      • 0
        @ 2023-9-6 19:41:10
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
            int n;
        	cin >> n;
        	int a=n/1000;
        	int b=n/100%10;
        	int c=n/10%10;
        	int d=n%10;
            n = n + a + b + c + d;
        	cout << n;
            return 0;
        }
        

        A

        • 0
          @ 2023-8-24 14:13:44

          过辣!(脑残人士的欢呼)

              long long n,sum=0;
              cin>>n;
              sum+=n;
              sum+=n/1000;//千
              sum+=n%10;//个
              n/=10;
              sum+=n%10;//十
              n/=10;
              sum+=n%10;
              cout<<sum;
          
          • 0
            @ 2023-1-15 10:55:22
            #include <iostream>//hetao3097453
            using namespace std;
            int main()
            {
                int n1;
                cin >> n1;
                int a = n1 % 10;
                int b = n1 / 10 % 10;
                int c = n1 / 100 % 10;
                int d = n1 / 1000;
                int n2 = a + b + c + d;
                cout << n1 + n2 << endl;
                return 0;
            }
            
            
            • 1

            信息

            ID
            614
            时间
            1000ms
            内存
            64MiB
            难度
            1
            标签
            递交数
            219
            已通过
            147
            上传者