Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int suma_div(int nr)
- {
- int d,sum=1;
- for (d=2; d*d<=nr; d++)
- if (nr%d==0)
- sum += d;
- if (sum == nr)
- return sum;
- else
- return -1;
- }
- int main()
- {
- int i,a,b,suma=0,s;
- cin>>a>>b;
- for (i=a; i<=b; i++)
- {
- s = suma_div(i) + 1;
- if (s > 0)
- suma += i;
- }
- cout<<suma;
- }
- _________________
- #include <iostream>
- using namespace std;
- #include <math.h>
- float aria_cerc(int R, int h)
- {
- return 2*3.14*R*h+3.14*R*R;
- }
- float volum_cerc(int R, int h)
- {
- return 3.14*R*R*h;
- }
- float aria_dreptunghi(int l, int L, int h)
- {
- return 2*(L+l)*h + l*L;
- }
- float volum_dreptunghi(int l, int L, int h)
- {
- return L*l*h;
- }
- float aria_patrat(int l, int h)
- {
- return 4*l*h+l*l;
- }
- float volum_patrat(int l, int h)
- {
- return l*l*h;
- }
- float aria_triunghi(int c1, int c2, int h)
- {
- return (c1+c2+sqrt(c1*c1+c2*c2))*h + c1*c2/2.0;
- }
- float volum_triunghi(int c1,int c2, int h)
- {
- return c1*c2*h/2.0;
- }
- int main()
- {
- int
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement