Skip to content

Ошибка при наборе кода #4246

@Goga0510

Description

@Goga0510

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

Исключение:
System.ArgumentOutOfRangeException: Значение должно быть больше или равно нулю и меньше, чем размер буфера в данной размерности.
Имя параметра: top
Фактическое значение было -1.
   в System.Console.SetCursorPosition(Int32 left, Int32 
top)
   в Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   в Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   в Microsoft.PowerShell.PSConsoleReadLine.Insert(Char 
c)
   в Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   в Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   в Microsoft.PowerShell.PSConsoleReadLine.InputLoop() 
   в Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

Screenshot

Исключение:
System.ArgumentOutOfRangeException: Значение должно быть больше или равно нулю и меньше, чем размер буфера в данной размерности.
Имя параметра: top
Фактическое значение было -1.
в System.Console.SetCursorPosition(Int32 left, Int32
top)
в Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
в Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
в Microsoft.PowerShell.PSConsoleReadLine.Insert(Char
c)
в Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable1 key, Object arg) в Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
в Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
в Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

Environment data

3.12

Steps to reproduce

x = int(input())

if x == 2:
print(28)
elif (x < 8 and x % 2 == 0) or (x > 7 and x % 2 != 0):
print(30)
else:
print(31)

Expected behavior

вывод на экран ответа на код

Actual behavior

выдает при любом коде ошибку

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions