3 条题解

  • 0
    @ 2023-3-12 11:20:56
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int a;
        cin>>a;
        int s=a%10+a/10%10+a/100;
        cout<<s;
    	return 0;
    }
    
    • -1
      @ 2025-10-29 22:12:06
      #include <bits/stdc++.h>
      using namespace std;
      #define LL long long
      const int N=1e6+10;
      string s;
      int main(){
      	ios::sync_with_stdio(false);
      	cin.tie(0);cout.tie(0);
      	cin>>s;
      	int ans=0;
      	for(auto x:s) ans+=x-'0';
      	cout<<ans;
      	return 0;
      }
      
      • -2
        @ 2023-4-1 21:49:08
        n = int(input(""))
        a = n // 100
        b = n % 100 // 10  
        c = n % 10  
        print(a+b+c)
        
        • 1

        信息

        ID
        19
        时间
        1000ms
        内存
        256MiB
        难度
        1
        标签
        (无)
        递交数
        332
        已通过
        258
        上传者