-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay 6.txt
More file actions
36 lines (36 loc) · 913 Bytes
/
Day 6.txt
File metadata and controls
36 lines (36 loc) · 913 Bytes
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
import java.util.*;
class Main
{
public static void main(String[]args)
{
Scanner sc = new Scanner(System.in);
int number1 = sc.nextInt();
int number2 = sc.nextInt();
int count = 0;
if(number1<number2)
{
System.out.println("Not possible");
}
else
{
boolean flag = false;
while(number1!=0 && number2!=0)
{
int temp1=0;
int temp2=number2%10;
if(flag)
temp1=number1%10;
if(temp1<temp2)
{
count++;
flag=true;
}
else
flag=false;
number1=number1/10;
number2=number2/10;
}
System.out.println(count);
}
}
}