UVA 382 - Perfection

Problem PDF

Solution:

#include
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
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/382/382.cpp