#include <bits/stdc++.h> using namespace std;
int main() { int m,n, a = 0; cin >> m>>n; for (int i = m; i <= n; i++) { bool s = true; for (int j = 2; j * j <= i; j++) { if (i % j == 0) { s = false; break; } } if (s) { a++; } } cout << a; return 0; }
使用您的 蒙青创OJ 通用账户