11 条题解

  • 9
    @ 2022-1-3 11:04:39
    #include <queue>
    #include <math.h>
    #include <stack>
    #include <stdio.h>
    #include <iostream>
    #include <vector>
    #include <iomanip>
    #include <string.h>
    #include <algorithm>
    using namespace std;
    #define LL long long
    const int N = 1e5 + 10;
    const int INF = 0x3f3f3f3f;
    int main()
    {	
    	int n;
    	cin >> n;
    	int b,s,g;
    	b = n/100;
    	s = n/10%10;
    	g = n%10;
    	if(b*b*b + g*g*g + s*s*s ==n)
    	{
    		cout <<"YES";
    	}
    	else
    	{
    		cout <<"NO";
    	}
    	return 0;
    }	
    
  • 1
    @ 2023-4-10 17:09:00
    #include <iostream>
    using namespace std;
    int main(){
            int n,num;
            cin>>n;
            num=n;
            int sum=0;
            for(int j=0;j<3;j++){
                sum+=(n%10)*(n%10)*(n%10);
                n/=10;
            }
            if(sum==num)
                cout<<"YES"<<endl;
            else   
                cout<<"NO"<<endl;
        return 0;
    }
    
    • 0
      @ 2024-6-1 19:06:13
      #include <iostream>
      using namespace std;
      int main(){
              int n,num;
              cin>>n;
              num=n;
              int sum=0;
              for(int j=0;j<3;j++){
                  sum+=(n%10)*(n%10)*(n%10);
                  n/=10;
              }
              if(sum==num)
                  cout<<"YES"<<endl;
              else   
                  cout<<"NO"<<endl;
          return 0;
      }
      //钟鼎皓
      
      • 0
        @ 2023-12-24 12:35:43

        #include<iostream> #include<cmath> using namespace std; const int N=1e3+10; const int INF=0x3f3f3f3f; int a,g,s,b; int main(){ cin>>a; g=a%10; b=a/100; s=a/10%10; if(sss+bbb+ggg==a) cout<<"YES"; else cout<<"NO"; }

        • 0
          @ 2023-4-5 16:56:30

          #include<bits/stdc++.h> using namespace std; int f(int n) { int bai,shi,ge; for(int i=100; i<=n; i++) { bai=i/100; shi=(i/10)%10; ge=i%10; if(baibaibai+shishishi+gegege==i) { return true; } } return false; } int main() { int n; cin>>n; if(f(n)) cout<<"YES"; else cout<<"NO"; return 0; }

          • 0
            @ 2021-12-4 12:23:25

            本题思路:分别将每个数提取出,并进行判断。
            计算乘方的快捷方式:

            pow(double x, double y);
            

            返回值:x的y次方
            注意:此函数需要包括库:

            #include <cmath>
            

            附上代码(很早以前写的很烂见谅)

            //Write by: FSC711300
            #include <bits/stdc++.h>
            using namespace std;
            int main(){
                int n;
                cin>>n;
                int hund=(n-n%100)/100;
                int ten=(n-n%10)/10-hund*10;
                int one=n-hund*100-ten*10;
                if(pow(hund,3)+pow(ten,3)+pow(one,3)==n) cout<<"YES";
                else cout<<"NO";
            }
            
            • -1
              @ 2022-1-23 13:12:44
              #include <iostream>
              using namespace std;
              int main(){
                      int n,num;
                      cin>>n;
                      num=n;
                      int sum=0;
                      for(int j=0;j<3;j++){
                          sum+=(n%10)*(n%10)*(n%10);
                          n/=10;
                      }
                      if(sum==num)
                          cout<<"YES"<<endl;
                      else   
                          cout<<"NO"<<endl;
                  return 0;
              }
              • -2
                @ 2023-1-12 16:09:04

                #include<iostream>

                using namespace std;

                int main(){

                int x,y;
                
                cin>>x>>y;
                
                if(x+y>10){
                
                	cout<<x*y;
                
                }else{
                
                	cout<<x-y;
                
                }
                

                Copy

                }

                • -2
                  @ 2022-7-2 18:10:44

                  #include<stdio.h> #include<iostream> using namespace std; int main() { int a; cin>>a; int b=a%10; int c=a/10%10; int d=a/100; if(bbb+ccc+ddd==a) { cout<<"YES"<<endl; }else { cout<<"NO"<<endl; } }

                  • -2

                    #include <queue> #include <math.h> #include <stack> #include <stdio.h> #include <iostream> #include <vector> #include <iomanip> #include <string.h> #include <algorithm> using namespace std; #define LL long long const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; int main() { int n; cin >> n; int b,s,g; b = n/100; s = n/10%10; g = n%10; if(bbb + ggg + sss ==n) { cout <<"YES"; } else { cout <<"NO"; } return 0; }

                    • -2
                      @ 2022-1-3 11:03:34
                      #include <stdio.h>
                      #include <iostream>
                      using namespace std;
                      int main()
                      {
                      	int n;
                      	cin >> n;
                      	int b,s,g;
                      	b = n/100;
                      	s = n/10%10;
                      	g = n%10;
                      	if(b*b*b + g*g*g+s*s*s ==n)
                      	{
                      		cout<<"YES";
                      
                      
                      	}
                      	else
                      	{
                      		cout << "NO";
                      
                      	}
                      
                      	
                      
                      
                      
                      
                      
                      
                      
                      
                      }
                      
                      
                      • 1

                      信息

                      ID
                      884
                      时间
                      1000ms
                      内存
                      128MiB
                      难度
                      5
                      标签
                      递交数
                      857
                      已通过
                      354
                      上传者