Cod sursa(job #618179)
Utilizator | Data | 15 octombrie 2011 15:00:05 | |
---|---|---|---|
Problema | Ciurul lui Eratosthenes | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.39 kb |
#include<fstream>
using namespace std;
ifstream f("ciur.in");
ofstream g("ciur.out");
//char v[2000001];
int j,i,k,n, ok;
int main(){
f>>n;
for(i=2;i<=n;i++){
ok = 1;
for (j=2;j<=i/2;j++)
if (i % j == 0)
ok = 0;
if (ok)
k++;
}
g<<k;
/*
i = 3;
j = i++;
j = ++i;
v = v op x;
v op= x;
*/
f.close();
g.close();
return 0;
}