Submission

Status:

PPP-PPPPPP

Subtask/Task Score:

90/100

Score: 90

User: kusir_laman

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-08-22 23:09:20


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

int n,i;
int prime_table[100] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    int size = sizeof(prime_table) / sizeof(prime_table[0]);
    for(int i=0;i<size;i++){
        if(prime_table[i]>=n){
            break;
        }
        cout << prime_table[i] << "\n";
    }
}