Home > Net >  C # programming
C # programming

Time:09-24

And the number of c # five-pointed star algorithm

CodePudding user response:

https://blog.csdn.net/weixin_30826095/article/details/99224848
Don't pull the algorithm on anything, are you sure you want to the algorithm of star?

CodePudding user response:

reference 1st floor qq_28644143 response:

https://blog.csdn.net/weixin_30826095/article/details/99224848Don't pull the algorithm on anything, are you sure you want to the algorithm of star?

This is the original
Pentagram number
If a five digits equals it every 5 digit square sum, then, we called "star number", for example: 55 + 45 + 54748=75 + 45 + 85,
Program design thought:
Find the pentagram, exhaustive method can also be adopted. For judging all five integers as one by one, if the sum of its digits 5 power equal to itself, is printing. Methods five digits from the smallest to the largest five digits in circulation, for each of the five digits separated it each number, and then ask each the five power of sum of the Numbers,

CodePudding user response:

You this is not very clear

CodePudding user response:

reference Bridge_go reply: 3/f
this is not very clear you

Is very clear!
But operate...

CodePudding user response:

A written on the mathematical formula:
A * 10 * 10 ^ 3 ^ 4 + b + c * 10 * 10 ^ 1 ^ 2 + d + e * 10 ^ 0=a + b ^ ^ 5 5 + c ^ ^ 5 + 5 + d e ^ 5

Solution a lot, so you seek mathematical algorithm similar to traverse the

CodePudding user response:

 
For (int I=10000; i<100000; I++)
{
A bit
10 b
C one hundred
D one thousand
E ten thousand
If (a * 10 * 10 ^ 3 ^ 4 + b + c * 10 * 10 ^ 1 ^ 2 + d + e * 10 ^ 0==a + b ^ ^ 5 5 + c ^ ^ 5 + 5 + d e ^ 5)
{
Console. WriteLine (I);
}
}


To use the formula of the upstairs, exhaustive method to have to do is write a for loop, speed fast don't know

CodePudding user response:

54748
92727
93084
There are three, I an a number, use head and help you calculate,

CodePudding user response:

refer to 7th floor a sugar packets boy reply:
54748
92727
93084
There are three, I an a number, use head and help you calculate,

Hey hey!
I just play out
  •  Tags:  
  • C #
  • Related