Submission

Status:

PPPPPP-PP-

Subtask/Task Score:

80/100

Score: 80

User: Veerawich

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

Language: cpp

Time: 0.003 second

Submitted On: 2026-01-03 14:02:57

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

Welcome to GDB Online.
  GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, 
  C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, COBOL, HTML, CSS, JS
  Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a;
    cin>>a;
    if(a <= 100) {
        for(int i=2;i<=a;i++) {
            int b = 0;
            for(int j = 2;j<i;j++) {
                if(i%j==0) {
                    b++;
                    
                }
            }
            if(b == 0) {
                cout<<i<<"\n";
            }
        }
    }
}