Pagini recente » Cod sursa (job #2536070) | Cod sursa (job #933392) | Cod sursa (job #2079995) | Cod sursa (job #1629747) | Cod sursa (job #2034977)
// ConsoleApplication22.cpp : Defines the entry point for the console application.
//
//#include "stdafx.h"
#include <fstream>
#include <math.h>
using namespace std;
ifstream f("ciur.in");
ofstream g("ciur.out");
int n,cnt;
bool mark[2000001];
void verif()
{
int i,j;
for (i = 2; i <=n; i++)
{
for (j = i+i; j <= n; j+=i)
{
mark[j] = 1;
}
if (mark[i] == 0)
cnt++;
}
}
int main()
{
int i;
f >> n;
verif();
g << cnt ;
return 0;
}