Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: loop

Problemset: จำนวนเฉพาะ (2560)

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-10 18:30:35

#include <iostream>
using namespace std;

int main() {
    int n;
    cin >> n;
    for (int x = 2; x < n; x++) {
        bool prime = true;
        for (int d = 2; d * d <= x; d++)
            if (x % d == 0) { prime = false; break; }
        if (prime) cout << x << '\n';
    }
    return 0;
}