Advertisement
Rofyda_Elghadban1

Untitled

Aug 30th, 2022
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4. #include <algorithm>
  5. #include <cstdlib>
  6. #include <limits.h>
  7. #include <string>
  8.  
  9. #define ll long long
  10.  
  11. using namespace std;
  12. void Fast_IO();
  13. void Rofyda_Elghadban(){
  14. #ifndef ONLINE_JUDGE
  15. freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  16. #endif
  17. }
  18. int main()
  19. { Rofyda_Elghadban();
  20. //Fast_IO();
  21. //freopen("input.txt","r",stdin);
  22. //freopen("output.txt","r",stdout);
  23. ll n,sum=0;
  24. cin>>n;
  25. for(ll i=1;i<=n;i++){
  26. if(n%i==0){
  27. sum+=i;
  28. }else{
  29. continue;
  30. }
  31. }cout<<sum;
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. return 0;
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement