Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: limsan
Problemset: จำนวนเฉพาะ (2560)
Language: cpp
Time: 0.002 second
Submitted On: 2026-06-10 20:06:11
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll x = 0, check = 0;
cin >> x;
for (ll i = 2; i < x; i++)
{
for (ll j = 1; j <= i; j++)
{
if (i % j == 0)
check++;
}
if (check == 2)
cout << i << "\n";
check = 0;
}
return 0;
}