fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. bool spp(int n){
  5. int u=0;
  6. for(int i=1;i<=n/2;i++){
  7. if(n%i==0){
  8. u+=i;
  9. }
  10. }
  11. if(u>n) return true;
  12. else return false;
  13. }
  14. int main()
  15. {
  16. int a,b,d=0;
  17. cin>>a>>b;
  18. for(int i=a;i<=b;i++){
  19. if(spp(i)) d+=1;
  20. }
  21. cout<<d;
  22. return 0;
  23. }
  24. //bai3
  25.  
Success #stdin #stdout 0s 5284KB
stdin
1 50;
2 43
stdout
9