-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaandi.c
49 lines (49 loc) · 977 Bytes
/
maandi.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include<stdio.h>
long long int lucky(long long int d)
{
long long int i,flag=0;
for(i=d;i>0;i=i/10)
{
if(i%10==4 || i%10==7)
{
flag=1;
break;
}
}
return flag;
}
int main()
{
long long int t,n,i,check,d1,d2,count;
scanf("%lld",&t);
while(t--)
{
scanf("%lld",&n);
count=0;
for(i=2;i*i<=n;i++)
{
if(n%i==0)
{
d1=i;
d2=n/i;
check=lucky(d1);
if(check==1)
{
count++;
// printf("%lld\n",d1);
}
check=lucky(d2);
if(check==1)
{
count++;
//printf("%lld\n",d2);
}
}
}
check=lucky(n);
if(check==1)
count++;
printf("%lld\n",count);
}
return 0;
}