11 条题解
-
8
#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
#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; }
-
1
本题思路:分别将每个数提取出,并进行判断。
计算乘方的快捷方式: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
#include
using namespace std;
int main(){
int x,y; cin>>x>>y; if(x+y>10){ cout<<x*y; }else{ cout<<x-y; }
}
-
-1
#include #include <math.h> #include #include <stdio.h> #include #include #include #include <string.h> #include 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; }
- 1
信息
- ID
- 884
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 4
- 标签
- 递交数
- 895
- 已通过
- 382
- 上传者