Submission
Status:
xxxxxxxxxx
Subtask/Task Score:
0/100
Score: 0
User: SRW
Problemset: จำนวนเฉพาะ (2560)
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-07 21:30:37
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
for (int i=2;i<n;i++){
bool isPrime = true;
for (int j=0;j*j<=i;j++){
if (i%j == 0){
isPrime = false;
break;
}
}
if (isPrime){
cout << i << " ";
}
}
}