Submission

Status:

Compilation Error

Subtask/Task Score:

Score: 0

User: SXLENG.S

Problemset: จำนวนเฉพาะก่อนหน้า

Language: cpp

Time: 0.000 second

Submitted On: 2025-11-29 16:22:02

#include<iostream>
#include<vector>
using namespace std;

int main()
{
	int x;
	cin>>x;
	int c=0;
	int y;
	y = x-1;
	vector<int> v(5);
	int a = 0;
	
	while (c<5){
		for (int i=2;i<x+1;i++){
			if (y%i != 0){
				c += 1;
				v[a] = y;
				a += 1;.
			}
			y -= 1;
		}
	}
	
	for (int i = v.size() - 1; i >= 0; i--) {
        cout << v[i] << " ";
    }	
}