Submission

Status:

Compilation Error

Subtask/Task Score:

Score: 0

User: Karatat007

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

Language: cpp

Time: 0.000 second

Submitted On: 2026-08-16 20:12:30

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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
     for (int i = 2; i <= n; ++i){
        bool prime = true;

        for (int i = 2; i * i <= i; i++) {
            if (x % i == 0) {
                prime = false;
                break;
            }
        }

        if (prime) {
            cout << i << '\n';
        }
    }

    
}