| |

VerySource

 Forgot password?
 Register
Search
Author: 丁欠欠

C ++ finished number

[Copy link]

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-23 23:45:02
| Show all posts
The sum of all different factors, the sum of the cubes of the digits is equal to the number itself
This refers to the number of daffodils. How to implement it in C++ code?
#include <iostream>
using namespace std;

int main()
{
int i,j,k;
int number;
for(number=100,number<1000,number++)
{
i=number/100;
j=(number%100)/10;
k=number%10;
if(number=i*i*i+j*j*j+k*k*k)
cout<<number:<<endl;
}
}
Reply

Use magic Report

0

Threads

46

Posts

23.00

Credits

Newbie

Rank: 1

Credits
23.00

 China

Post time: 2020-8-24 05:30:01
| Show all posts
Indicates that you have participated
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list