-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path40.c
55 lines (50 loc) · 2.95 KB
/
40.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
50
51
52
53
54
55
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int t,i,j;
int t1,t2,t3;
int k;
int count;
int a;
int arr[9]={0};
for(i=1;i<=99;i++)
{
t1=i;
for(j=100;j<=2000;j++)
{
t2=j;t3=i*j;k=0;count=0;
if(ceil(log10(i))+ceil(log10(j))+ceil(log10(i*j))==9)
{
while(t1!=0)
{
arr[k]=t1%10;
t1=t1/10;k++;
}
while(t2!=0)
{
arr[k]=t2%10;
t2=t2/10;k++;
}
while(t3!=0)
{
arr[k]=t3%10;
t3=t3/10;k++;
}
for(a=1;a<=9;a++)
{
for(k=0;k<=9;k++)
{
if(arr[k]==a)
{
count ++;break;
}
}
}
if(count==9)
printf("%d\t%d\t%d\n",i,j,i*j);
}
}
}
}