Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- void main(){
- int s = 0,i,n;
- scanf("%d",&n);
- for(i = 1; i <= n/2; i++){
- if(n%i == 0){
- s += i;
- }
- }
- if(s == n){
- printf("Nr este perfect.");
- }else{
- printf("Nr nu este perfect.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment