C++ 发生运行时错误问题是什么?

C++ 发生运行时错误问题是什么?,c++,syntax-error,C++,Syntax Error,我试图找到平均值,但这无法解决。显示“runtime erorr”的代码请帮助我我的代码如下: cin >> n; while (n > 100 || n <= 0) { cout << "Error! number should in range of (1 to 100)." << endl; cout << "Enter the number agai

我试图找到平均值,但这无法解决。显示“runtime erorr”的代码请帮助我我的代码如下:

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;
    }
cin>>n;

虽然(n>100 | | n我不明白“n”代表什么。我发现你的脚本有一些问题。首先你应该定义“n”。其次,最好不要使用循环进行检查。 第三,我建议你使用这个代码:

intn;
cin>>n;

如果(n>100&&n什么是
n
,它是在哪里定义的?请参阅,然后发布完整的代码、您输入的输入以及您得到的确切错误消息。此代码段似乎没有引发运行时错误……如果这是关于运行时错误的,为什么您的问题会标记为“语法错误”?
int n;
cin>>n;
if(n>100 && n<0)
{
   cout << "Error! number should in range of (1 to 100)." << endl;
   cout << "Enter the number again: ";
   cin >> n;
}