Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int x, z;
- cin >> x >> z;
- int max_deliteli = 0;
- int broj_so_max_deliteli = 0;
- for(int i = x; i <= z; i += 1) {
- int deliteli = 0;
- for(int j = 1; j <= i; j += 1) {
- if(i % j == 0) {
- deliteli += 1;
- }
- }
- if(deliteli > max_deliteli) {
- max_deliteli = deliteli;
- broj_so_max_deliteli = i;
- }
- }
- cout << broj_so_max_deliteli << " " << max_deliteli << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement