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