【发布时间】:2023-03-15 02:44:02
【问题描述】:
我试图找到平均值,但这无法解决。此代码显示“运行时错误”请帮助我,我的代码在这里:
cin >> n;
while (n > 100 || n <= 0)
{
cout << "Error! number should in range of (1 to 100)." << endl;
cout << "Enter the number again: ";
cin >> n;
}
【问题讨论】:
-
什么是
n,它在哪里定义?请参阅How to create a Minimal, Reproducible Example,然后发布完整的代码、您输入的输入以及您收到的确切错误消息。 -
运行时错误似乎不会从此代码 sn-p...
-
如果这是关于运行时错误,为什么您的问题会被标记为“语法错误”?
标签: c++ syntax-error