Cod sursa(job #1031886)
| Utilizator | Data | 15 noiembrie 2013 18:34:04 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | FMI No Stress 4 | Marime | 0.61 kb |
#include<stdio.h>
#include<string.h>
using namespace std;
char c[100];int i,s,n;long long a;
int main()
{
freopen("dtcsu.in","r",stdin);
for(i=1;i<=276997;++i)
scanf("%s",&c);
scanf("%d",&n);
for(i=1;i<=n;++i)
{
scanf("%lld",&a);
while((a>1)&&(a%2==0)) a=a/2;
while((a>1)&&(a%3==0)) a=a/3;
while((a>1)&&(a%5==0)) a=a/5;
while((a>1)&&(a%7==0)) a=a/7;
while((a>1)&&(a%11==0)) a=a/11;
if(a==1) s++;
}
fclose(stdin);
freopen("dtcsu.out","w",stdout);
printf("%d",s);
fclose(stdout);
return 0;
}
