3 条题解

  • 3
    @ 2026-3-28 15:54:45

    #include <bits/stdc++.h> using namespace std;

    int main() { long long x, y, sum = 0; cin >> x >> y; if (x > y) swap(x, y); for (int i = x; i <= y; i++) { bool q = 1; for (int j = 2; j <= sqrt(i); j++) if (i % j == 0) { q = 0; break; } if (q && i != 1) sum++; } cout << sum << endl; return 0; }

    信息

    ID
    12098
    时间
    1000ms
    内存
    128MiB
    难度
    1
    标签
    递交数
    32
    已通过
    10
    上传者