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 1119. Metro

Comp error
Posted by nexerd 2 Oct 2014 19:44
 while (n>0)
      {
            b=a;
            b=b/pow(10,n-1) - rezult/pow(10,n-1);
            for (int i=1;i<10;i++)
            if ((b-i>=0)&(b-i-1<0))  rezult += (i)*pow(10,n-1);
            n--;
      }
/*
if delete :

b=b/pow(10,n-1) - rezult/pow(10,n-1);
            for (int i=1;i<10;i++)
            if ((b-i>=0)&(b-i-1<0))  rezult += (i)*pow(10,n-1);

- work! */
Re: Comp error
Posted by Alexander Vasilyev`~ 19 Mar 2018 16:47
1. Which programming language do you use?
2. Did you name the variable for result "rezult" (if there is need to pre-declare variables in yout PL)?