Pagini recente » Cod sursa (job #305498) | Cod sursa (job #920278) | Cod sursa (job #1450653) | Cod sursa (job #2773959) | Cod sursa (job #452715)
Cod sursa(job #452715)
#include<iostream.h>
#include<fstream.h>
long long a[2000001],i,t,n;
int main()
{ifstream f("ciur.in");
ofstream g("ciur.out");
f>>n;
for(i=1;i<=n-1;i++)
a[i]=i+1;
for(i=1;i<=n;i++){
if((a[i]!=2)&&(a[i]!=0)&&(a[i]%2==0)){a[i]=0;t++;}
if((a[i]!=3)&&(a[i]!=0)&&(a[i]%3==0)){a[i]=0;t++;}
if((a[i]!=5)&&(a[i]!=0)&&(a[i]%5==0)){a[i]=0;t++;}
if((a[i]!=7)&&(a[i]!=0)&&(a[i]%7==0)){a[i]=0;t++;}
}
g<<t;
}