Advertisement
heian

Untitled

Oct 30th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int i,nrdiv,i;
  8. for(i=1;i<=n;i++)
  9. {
  10. nrdiv = 0;
  11. for(d=1;d*d<i;d++)
  12. if(i%d==0)
  13. nrdiv+=2;
  14. if(d*d==i)
  15. nrdiv++;
  16. x = x_ant + nrdiv;
  17.  
  18. x_ant = x;
  19. }
  20. cout<<x<<"\n";
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement