Cod sursa(job #1032524)
| Utilizator | Data | 15 noiembrie 2013 19:36:59 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | FMI No Stress 4 | Marime | 0.65 kb |
#include<fstream>
#include<cstring>
#include<cstdlib>
#include<algorithm>
using namespace std;
int Q;
int main()
{
char s[30];
fstream f("dtcsu.in",ios::in);
fstream g("dtcsu.out",ios::out);
for (int i=1;i<=276997;++i)
{
f.getline(s,20);
}
f>>Q;f.get();
int nr=0;
for (int i=1;i<=Q;++i)
{
f.getline(s,20);
int x=atoi(s);
if (x!=0){
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<<'\n';
return 0;
}