Блог пользователя DragonFruit

Автор DragonFruit, 9 лет назад, По-английски

Hi

I tried to solve a problem by this code: 10907824

but when i run it in my computer i face with a terrible voice that can't stop it and lots of this outputs:

What's wrong?

  • Проголосовать: нравится
  • +9
  • Проголосовать: не нравится

»
9 лет назад, # |
  Проголосовать: нравится -16 Проголосовать: не нравится

wrong operating system

»
9 лет назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

for(int j=0;i<2*n-1;j++)

Bug. You must use j

»
9 лет назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится

Looks like you haven't ran your code until you wrote full solution. Very bad idea.

You may use code binary search to find the error: comment out half of the code and see if it still fails. Of course, comment from last lines to first, so commenting won't affect execution.

This 'weird voice' is actually your program printing the bell character to the console. Lots of output means that there is either null terminator missing or damaged for some string (if you print strings) or you wrote output loops wrong.

Your case is the second one: for(int j=0;i<2*n-1;j++) — that's the error.

»
9 лет назад, # |
Rev. 4   Проголосовать: нравится +15 Проголосовать: не нравится

this site can be useful for you.