Home c++ Algorithm of the Deixtra Sorting Station, the problem with double-digit numbers

Algorithm of the Deixtra Sorting Station, the problem with double-digit numbers

Author

Date

Category

With unequivocal numbers, everything works fine, but with double-digit – it does not displays, for a couple of hours stupid, do not tell me a mistake?


Answer 1, Authority 100%

First, Isnumber Replace the library isdigit , and secondly, repeat the “horror flying on the wings of the night” (c), for example, as follows:

else if (isdigit (s [i]))
{
   int val = 0;
   While (ISDIGIT (S [I]))
   {
     Val = Val * 10 + (s [i] - '0');
     ++ I;
   }
   --i;
   STLET.PUSH (VAL);
}

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions