rotti321

guIT

May 14th, 2021
420
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     long long n, d=2, S=0, p;
  8.     cin>>n;
  9.     while(n>1){
  10.         p=0;
  11.         while(n%d==0){
  12.             n/=d;
  13.             p++;
  14.         }
  15.         if(p>0){
  16.             S+=d;
  17.         }
  18.         d++;
  19.     }
  20.     cout<<S;
  21.     return 0;
  22. }
RAW Paste Data