Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int suma_div(int nr)
  4. {
  5. int d,sum=1;
  6. for (d=2; d*d<=nr; d++)
  7. if (nr%d==0)
  8. sum += d;
  9. if (sum == nr)
  10. return sum;
  11. else
  12. return -1;
  13. }
  14. int main()
  15. {
  16. int i,a,b,suma=0,s;
  17. cin>>a>>b;
  18. for (i=a; i<=b; i++)
  19. {
  20. s = suma_div(i) + 1;
  21. if (s > 0)
  22. suma += i;
  23. }
  24. cout<<suma;
  25. }
  26.  
  27.  
  28.  
  29.  
  30.  
  31. _________________
  32.  
  33.  
  34. #include <iostream>
  35. using namespace std;
  36. #include <math.h>
  37. float aria_cerc(int R, int h)
  38. {
  39. return 2*3.14*R*h+3.14*R*R;
  40. }
  41. float volum_cerc(int R, int h)
  42. {
  43. return 3.14*R*R*h;
  44. }
  45. float aria_dreptunghi(int l, int L, int h)
  46. {
  47. return 2*(L+l)*h + l*L;
  48. }
  49. float volum_dreptunghi(int l, int L, int h)
  50. {
  51. return L*l*h;
  52. }
  53. float aria_patrat(int l, int h)
  54. {
  55. return 4*l*h+l*l;
  56. }
  57. float volum_patrat(int l, int h)
  58. {
  59. return l*l*h;
  60. }
  61. float aria_triunghi(int c1, int c2, int h)
  62. {
  63. return (c1+c2+sqrt(c1*c1+c2*c2))*h + c1*c2/2.0;
  64. }
  65. float volum_triunghi(int c1,int c2, int h)
  66. {
  67. return c1*c2*h/2.0;
  68. }
  69. int main()
  70. {
  71. int
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement