Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Run time error

Posted by Mohamed at 2008-06-26 11:26:44 on Problem 1316 and last updated at 2008-06-26 11:27:21
i get run time error , I solved this problem in another judge and get accepted , so what is the error , and thanx in advance
this my code 

# include <iostream>
# include <algorithm>
using namespace std;


bool SelfNumbers[10005];


int Sumdigits(int num)
{
   int sum = 0;
   while(num != 0)
   {
      sum += num % 10;
      num /= 10;
   }
   return sum;
}

void Self()
{
   fill(SelfNumbers,SelfNumbers+10005,true);
   int temp;
   for (int i = 0 ; i <= 10005 ; i++)
   {
      temp = i + Sumdigits(i);
      SelfNumbers[temp] = false;
   }
   SelfNumbers[10000] = true;
}

int main()
{
   Self();
   for (int i = 0 ; i <= 10000;i++)
   {
      if (SelfNumbers[i])
         cout<<i<<endl;
   }
   return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator