Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <algorithm>
- #include <cmath>
- using namespace std;
- int f(int n) {
- int d = 2;
- for (int i = 2; i < sqrt(n); i++) {
- if (n % i == 0) {
- d += 2;
- }
- }
- return d;
- }
- int main()
- {
- int a, b, maxim;
- cin >> a >> b;
- cout << f(6) << endl;
- maxim = -10000000000000;
- for (int i = a; i <= b; i++) {
- if (f(i) > maxim) {
- maxim = f(i);
- }
- }
- for (int i = a; i <= b; i++) {
- if (f(i) == maxim) {
- cout << i << " ";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement