I came up this morning to get one way to get all the numbers of N, I feel very interesting, put it out, give you a look!

zhaozj2021-02-16  52

I used to consider this problem when I judge a number of prizes. I didn't even consider it.

I am doing this today:

First define a data structure

Typedef stracut tagsush {

Int nsunshucount;

INT * SUSHUTEMP [MAX_SIZE]

}

Then define an instance of this structure

Add SUSHUTEMP [0] 2

NSUNSHUCOUNT Add 1

Then start from 3 to n to determine one by one

The method of judging is to remove the number of prime in the array. If you can do it, you will be skipped. If it doesn't finish, it will be a single digit, add it to an array.

In this way, we added all the numbers to the array.

Oh, it seems to be a little meaning! !

转载请注明原文地址:https://www.9cbs.com/read-27762.html

New Post(0)