Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: nunos
Problemset: จำนวนเฉพาะ (2560)
Language: cpp
Time: 0.004 second
Submitted On: 2025-09-29 19:00:18
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int count=0;
int x;cin>>x;
if(x==2){cout <<2;return 0;}
for(int i=1;i<x;i++){
for(int j=1;j<x;j++){
if(i%j==0) count++;
}
if(count==2) cout << i<<"\n";
count=0;
}
return 0;
}