Pagini recente » Rating GeorgeBogdanOprea323CC (George_Bogdan.Oprea_323CC) | Statistici Victor Hohlov (Victor_Hohlov_322CC) | Cod sursa (job #1519312) | Monitorul de evaluare | Cod sursa (job #1500721)
#include <bits/stdc++.h>
using namespace std;
ifstream f("ciur.in");
ofstream g("ciur.out");
const int Nmax= 2e6 + 5;
int k;
bool viz[Nmax];
void ciur(int n)
{
k=1;
for(int i=3; i<=n; i=i+2)
{
if(viz[i]==0)
{
k++;
for(int j=3*i; j<=n; j=j+(2*i))
{
viz[j]=true;
}
}
}
}
int main()
{ int x;
f>>x;
ciur(x);
g<<k;
return 0;
}