UVA 10392

#include<iostream>
#include<vector>
using namespace std;
int main()
{
    long long n;
    while(cin>>n)
    {
        if(n<0)break;
        if(n==1)cout<<"    "<<1<<endl;
        else
        {
            vector<long long>v;
            long long i=2;
            while(true)
            {
                if(i*i>n)
                {
                    if(n!=1)
                        v.push_back(n);
                    break;
                }
                while(n%i==0)
                {
                    v.push_back(i);
                    n=n/i;
                }
                i++;
            }
            for(int j=0;j<v.size();j++)
                cout<<"    "<<v[j]<<endl;
        }
        if(n>=0)cout<<endl;
    }
    return 0;
}

 

posted @ 2012-04-28 12:16  open your eyes  阅读(152)  评论(0编辑  收藏  举报