Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: sulinx
Problemset: จำนวนเฉพาะ (2560)
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-12 12:51:12
#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n)
{
for (int i = 2; i < n; i++)
if (n % i == 0)
return false;
return true;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
for(int i = 2;i<n;i++){
if(isPrime(i)){
cout << i << '\n';
}
}
}