Problem Link
Solution :-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#include<stdio.h> int main() { int n,i,j,k,l,m,sum; printf("PERFECTION OUTPUT\n"); while(scanf("%d",&n)==1) { if(n==0) break; sum=0; for(i=1;i<=n/2;i++) { if(n%i==0) sum=sum+i; printf("%d",sum); } if(sum==n) { printf("%5d PERFECT\n",n); } else if(sum<n) { printf("%5d DEFICIENT\n",n); } else { printf("%5d ABUNDANT\n",n); } } printf("END OF OUTPUT\n"); return 0; } |
Now judge me. I do not copy your code but a statement only. Should this website for me or you will agree about your bug???