Cod sursa(job #1032214)
| Utilizator | Data | 15 noiembrie 2013 19:04:41 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | FMI No Stress 4 | Marime | 0.52 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
string s;
long long i,n,x;
long long nr=0;
ifstream f("dtcsu.in");
for (i=0; i<276997; i++)
getline(f,s);
f>>n;
for (i=0; i<n; i++) {
f>>x;
while (x%2==0) x/=2;
while (x%3==0) x/=3;
while (x%5==0) x/=5;
while (x%7==0) x/=7;
while (x%11==0) x/=11;
if (x==1) nr++;
}
ofstream g("dtcsu.out");
g<<nr<<'\n';
return 0;
}
