3 条题解

  • 2
    @ 2023-11-18 14:33:58

    #include<bits/stdc++.h> using namespace std; int main(){ int a,g,s,b; cin>>a; g=a%10; s=a/10%10; b=a/100; cout<<g+s+b; return 0; }

    • 1
      @ 2023-3-19 13:31:20

      #include<bits/stdc++.h> using namespace std; int main() { int x,s; cin>>x; if(x>=100&&x<=999) { s=x/100+x%100/10+x%100%10; cout<<s; } return 0; }

      • -1
        @ 2022-11-12 10:27:19
        #include<bits/stdc++.h>
        
        using namespace std;
        
        int main()
        
        {
        
        int x,s;
        
        cin>>x;
        
        if(x>=100&&x<=999)
        {
        
        s=x/100+x%100/10+x%100%10;
        
        cout<<s;
        
        }
        
        }
        
        • 1

        【入门】求任意三位数各个数位上数字的和

        信息

        ID
        294
        时间
        1000ms
        内存
        16MiB
        难度
        1
        标签
        递交数
        25
        已通过
        24
        上传者