Submission

Status:
PPPPPPPPPP

Score: 100

User: Monasm

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

Language: cpp

Time: 0.002 second

Submitted On: 2024-10-02 20:37:12

/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>
using namespace std;

int main()
{
    int n;cin >> n;
    for(int i=2;i<n;i++){
        int con = 1;
        for(int j=2;j<i;j++){
            if(i%j==0){
                con = 0;
            }
        }
        if(con){
            cout<<i<<endl;
        }
    }

    return 0;
}