Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <limits>
- using namespace std;
- int main()
- {
- vector<int> a;
- vector<int> b;
- int count = 0, j, max = 0;
- cin >> j;
- for (int k = 1; k <= j; k++) {
- for (int i = 1; i <= k; i++)
- {
- if (k % i == 0)
- count++;
- }
- a.push_back(k);
- b.push_back(count);
- count = 0;
- }
- for (int i = 0; i < b.size(); i++) {
- if (b[i] == *max_element(b.begin(), b.end())) {
- max = i;
- break;
- }
- }
- cout << a[max] << endl;
- for (int i = 1; i <= 20; i++)
- {
- if (20 % i == 0)
- cout << i << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement