about | help | code help+videos | done | prefs |
HPCW2020_04_BookEm
Book 'em, Danno Problem 04 Worth 2 points Troy and Gabriel are shelving books at a public library. Troy shelves X books at a time, whereas Gabriel shelves Y at a time. If they end up shelving the same number of books, write a program to find the smallest number of books each could have shelved. You will receive 2 lines of input, the first will be Troy's books shelved, the second will be Gabriel's. Because you are told that the 2 people shelve the same number of books, and that they finish at the same time, you need to look for lowest multiple of the 2 numbers. E.G. People shelving 5 books at a time, and 6 books at a time will intersect and have shelved the same number of books at books: 30, 60, 90, etc. The lowest number they could both shelve at the same time is 30. HPCW2020_04_BookEm(10, 6) → 30 HPCW2020_04_BookEm(4, 10) → 20 HPCW2020_04_BookEm(12, 30) → 60 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy