Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int N,S=0;
  5. cin >> N;
  6. for (int i = 1; i <= N; i++) {
  7. if (N % i == 0) {
  8. S += i;
  9.  
  10. }
  11. }
  12. cout << S;
  13. return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement