ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1014. Product of Digits

i will be greatful to u if ypu help me to sort out the error in this code....
Posted by neolithic 22 Sep 2008 23:30
#include<iostream>
using namespace std;
int main()
{
    int j,i,temp=0,p=0,a[10];
    long long int n,k;
    cin>>n;
    if (n/10==0)
    {
                cout<<1<<n;
                p=1;
    }

     for(i=9,k=n,j=0;i>1&&p==0;)
    {
              if(k%i==0)
              {
                         a[j++]=i;
                         k=k/i;
                         temp=1;
              }
              else i--;
    }
    for(i=--j;temp==1&&i>=0&&p==0;i--)
    {
     cout<<a[i];
    }
    if (temp==0)
    cout<<-1;
    system("PAUSE");
    return(0);
}
Re: i will be greatful to u if ypu help me to sort out the error in this code....
Posted by Dijkztra 12 Nov 2009 09:01
neolithic wrote 22 September 2008 23:30
system("PAUSE");

Don't use system pause.

Edited by author 12.11.2009 09:02