Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <cstdio>
- #include <iostream>
- #include <cmath>
- #include <vector>
- using namespace std;
- int main()
- {
- long long M, N;
- scanf("%lli %lli", &M, &N);
- vector <int> jndtn;
- for (int i = M; i <= N; ++i)
- {
- int a = 0;
- for (int j = 1; j*j <= i; ++j)
- {
- if (i % j == 0)
- {
- if (i / j == i)
- {
- a = a + j;
- }
- else
- {
- a = a + j + i / j;
- }
- }
- }
- if (a == i)
- {
- if (i > 1)
- {
- jndtn.push_back(i);
- }
- }
- }
- if (jndtn.size() == 0)
- {
- printf("Absent");
- }
- else
- {
- for (int i = 0; i < jndtn.size()-1; ++i)
- {
- printf("%d\n", jndtn[i]);
- }
- printf("%d", jndtn[jndtn.size() - 1]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement