Cod sursa(job #1267609)
Utilizator | Data | 20 noiembrie 2014 01:25:12 | |
---|---|---|---|
Problema | Dtcsu | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include<iostream>
#include<fstream>
using namespace std;
ifstream in("dtcsu.in");
ofstream out("dtcsu.out");
int main(){
char s[20];
unsigned int l=276997,q,cnt=0;
long long n;
while(l){
in.get(s,21);
in.get();
l--;
}
in>>q;
while(q){
q--;
in>>n;
while(n%2==0)
n/=2;
while(n%3==0)
n/=3;
while(n%5==0)
n/=5;
while(n%7==0)
n/=7;
while(n%11==0)
n/=11;
if(n==1)
cnt++;
}
out<<cnt;
return 0;
}