Pagini recente » Cod sursa (job #970008) | Borderou de evaluare (job #2559011) | Statistici Petre Andreea Cristina (angel_pac) | Cod sursa (job #690567) | Cod sursa (job #2428699)
#include <fstream>
#include <cmath>
using namespace std;
ifstream in("ciur.in");
ofstream out("ciur.out");
int n, i, j, x = 1;
bool t[2000005];
int main()
{
in >> n;
t[0] = t[1] = true;
for (i = 2; i <= int(sqrt(n)); i ++)
if (!t[i])
for (j = 2; j <= n/i; j ++)
if (!t[i*j]){
t[i*j] = true;
x ++;
}
out << n-x;
return 0;
}