What are recurring decimal places
This question is a little difficult for me, it is very important to study the ideas contained in it! !
Enter the integers a and b (0 <= a <= 3000.1 <= b <= 3000) and output the cyclic decimal representation of a / b and the length of the cyclic section.
76/25 = 3.04(0)
The length of the loop section is 1
5/43 = 0.(116279069767441860465)
The length of the loop section is 21
1For decimal point processing, which I have already done, we need to use elementary school basic methods to deal with it, multiply by 10 to get the rest
2There should be a cyclic decimal place here, meaning the rest is the same (special treatment if broken).
3It is very smart to deal with whether the rest is the same as the previous one. Use an array to deal with this!
4After all, all you have to do is look for the repeated remainder from the start, find the same and know the length of the loop section
5A little math knowledge, for a / b there are only b cases for the remainder (0,1,2 ... b-1) so don't be afraid to do a loop many times
The code is as follows: (๑ • ̀ ㅂ • ́) و✧
- Who sang the song Crazy Beat in 2003
- What's the best digital painting app
- Why are encoders used in digital electronics
- But what feels illegal is not
- Ants have hearts
- What is the unified system of accounting
- Should addictive cell phone games be illegal
- What does artesian water bring
- What is a Friedel Crafts reaction
- What's going on with colleges today
- Who uses deep web
- What is the history of wood pellets
- What are some common scams in Wellington
- Phenol is more stable than alcohol Why
- How can CS Engineering help in banking
- ICharge has an expiration date
- What devilish thoughts did you have today?
- What does the Hadoop cluster topology mean
- Can rappers use the voice
- Is Uber Eats a pyramid scheme
- What is the third angle projection method
- Are billboards an effective form of advertising
- What skills are required for a BBA
- What do small children dream of?
- Star formation reduces entropy
- Are correspondence courses valid for jobs
- What causes colors in aurora lights
- Why Facebook removed remember the feature
- Why are expenses debited and income credited
- Why do redheads need more anesthesia
- What is the concept of green vehicles
- Does Akshay Kumar have an Indian passport
- What is the biggest mountain
- Can two friends open a joint account