Cod sursa(job #1267614)

Utilizator mariusbsUnibuc Serban mariusbs Data 20 noiembrie 2014 01:46:25
Problema Dtcsu Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include<iostream>
#include<fstream>
using namespace std;
ifstream in("dtcsu.in");
ofstream out("dtcsu.out");

void skip(char ar[],int n)
{
	int i;
	for(i=0;i<n;i++)
	{
		scanf("%[^\n]s",ar);
		scanf("%*c");
 
	}
}

int main(){
	
char s[20];
unsigned int l=276997,q,cnt=0;
long long n;

skip(s,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;
}