14 条题解
- 1
信息
- ID
- 887
- 时间
- 1000ms
- 内存
- 64MiB
- 难度
- 2
- 标签
- 递交数
- 350
- 已通过
- 208
- 上传者
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"153 370 371 407";
return 0;
}
你牛呀!!!直接“cout”这些数!!!
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,i;
for(i=10;i<1000;i++){
a=i%10;
b=i/10%10;
c=i/100;
if(pow(a,3)+pow(b,3)+pow(c,3)==i)
cout<<i<<" ";
}
return 0;
}
```#include <iostream>
#include <cmath>
using namespace std;
int main(){
for(int num=100;num<1000;++num) {
int sum=0;
int temp=num;
while(temp>0){
int digit=temp%10;
sum+=pow(digit,3);
temp/=10;
}
if(sum == num){
cout<<num<<" ";
}
}
return 0;
}
#include #include
using namespace std;
int main() {
for (int num = 100; num < 1000; ++num) {
int sum = 0;
int temp = num;
while (temp > 0) {
int digit = temp % 10;
sum += pow(digit, 3);
temp /= 10;
}
if (sum == num) {
cout << num <<" ";
}
}
return 0;
}
#include<bits/stdc++.h> using namespace std; int main(){ int n,x; for(int y=100;y<=999;y++){ if((y%10)(y%10)(y%10)+(y/10%10)(y/10%10)(y/10%10)+(y/100%10)(y/100%10)(y/100%10)==y){ cout<<y<<" "; } } return 0; }
#include <iostream>
#include <cmath>
using namespace std;
int main(){
for(int num=100;num<1000;++num) {
int sum=0;
int temp=num;
while(temp>0){
int digit=temp%10;
sum+=pow(digit,3);
temp/=10;
}
if(sum == num){
cout<<num<<" ";
}
}
return 0;
}
#include #include
using namespace std;
int main() {
for (int num = 100; num < 1000; ++num) {
int sum = 0;
int temp = num;
while (temp > 0) {
int digit = temp % 10;
sum += pow(digit, 3);
temp /= 10;
}
if (sum == num) {
cout << num <<" ";
}
}
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
int main() {
for (int num = 100; num < 1000; ++num) {
int sum = 0;
int temp = num;
while (temp > 0) {
int digit = temp % 10;
sum += pow(digit, 3);
temp /= 10;
}
if (sum == num) {
cout << num <<" ";
}
}
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
int main() {
for (int num = 100; num < 1000; ++num) {
int sum = 0;
int temp = num;
while (temp > 0) {
int digit = temp % 10;
sum += pow(digit, 3);
temp /= 10;
}
if (sum == num) {
cout << num <<" ";
}
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"153 370 371 407";
return 0;
}
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,i; for(i=100;i<=999;i++){ a=i%10; b=i/10%10; c=i/100; if(pow(a,3)+pow(b,3)+pow(c,3)==i){ cout<<i<<" "; } } return 0; }``
#include <iostream>
#include <cmath>
using namespace std;
int main() {
for (int num = 100; num < 1000; ++num) {
int sum = 0;
int temp = num;
while (temp > 0) {
int digit = temp % 10;
sum += pow(digit, 3);
temp /= 10;
}
if (sum == num) {
cout << num <<" ";
}
}
return 0;
}
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
int a[10000];
string s1,s2,s3,s4;
signed main(){
cout<<"153 370 371 407";
return 0;
}