Cod sursa(job #1192675)
Utilizator | Teofil Teofilos | Data | 29 mai 2014 15:30:33 |
---|---|---|---|
Problema | Ciurul lui Eratosthenes | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.32 kb |
#include <fstream>
#include <iostream>
using namespace std;
ifstream in("ciur.in");
ofstream out("ciur.out");
int main()
{
int N;
int S = 0, OK=0;
in>>N;
for ( int i=1; i<=N ;i++ ) {
if ( N % i == 0) OK = 1;
if ( OK == 1 ) S++;
OK = 0;
}
cout << S;
return 0;
}