Cod sursa(job #356041)

Utilizator matzipanAndrei matzipan Data 13 octombrie 2009 12:36:12
Problema Ciurul lui Eratosthenes Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.27 kb
#include <fstream>

using namespace std;
ifstream in("ciur.in");
ofstream out("ciur.out");
long N,i,x,nr; 

long era() {
	long nr;
	nr=N;
	for(x=2; x*i<N; x++) 
		nr--;
	if(2*i>N) nr=0;
	return nr;
}
int main() {
	in>>N;
	nr=era();
	out<<nr;
	return 0;
}