问题遇到的现象和发生背景
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x, y;
cin >> x >> y;
int count = 0;
if(x > y)
{
swap(x, y);
}
for (int i = x; i <= y; i++)
{
bool ans = true;
for (int j = 2; j <= i / 2; j++)
{
if(i % j == 0)
{
ans = false;
break;
}
}
if(ans == true)
{
count++;
}
}
cout << count;
return 0;
}