Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Tinh tong tat ca uoc so chan cua so nguyen duong n
- // Khai bao thu vien
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- int n;
- scanf("%d",&n);
- long s=0;
- for(int i=1;i<=n;i++)
- {
- if(n%i==0)
- {
- if(i%2==0)// so chan
- {
- s=s+i;
- }
- }
- }
- printf("%ld",s);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement