Pagini recente » Cod sursa (job #1149544) | Cod sursa (job #1336748) | Rating Cristina (Info1) | Cod sursa (job #501414) | Cod sursa (job #2021780)
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("dtcsu.in");
ofstream g("dtcsu.out");
long long q,x,i,y,nr;
int main()
{
for(i=1;i<=276997;i++)
{
f>>y;
}
f>>q;
for(i=1;i<=q;i++)
{
f>>x;
while(x%2==0)
{
x=x/2;
}
while(x%3==0)
{
x=x/3;
}
while(x%5==0)
{
x=x/5;
}
while(x%7==0)
{
x=x/7;
}
while(x%11==0)
{
x=x/11;
}
if(x==1)
{
nr++;
}
}
g<<nr;
return 0;
}