boj1232

http://acm.scs.bupt.cn/onlinejudge/showproblem.php?problem_id=1232

很简单的一道题,不过一直wa,之后才发现原来0应该用10表示!!!郁闷!!!

 

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int n,m,i,j,sum[100],total;
    scanf("%d",&n);
    m = n;
    if (== 0)
       printf("10\n");
    else
    if (== 1)
       printf("1\n");
    else
    {
    
        total = 0;
        for (= 9;> 1;i--)
        {
            while(% i == 0)
            {
                    sum[total] = i;
                    total++;
                    m /= i;
            }
        }
        if (!= 1)
           printf("-1\n");
        else
        {
            for (= total-1;>=0;i--)
                 printf("%d",sum[i]);
            printf("\n");
        }
    }
    // system("Pause");
    return 0;
}

 

posted @ 2009-05-16 00:30  xinguohenan  阅读(150)  评论(0编辑  收藏  举报