My issue
My code
// Update the code below to solve this problem
import java.util.Scanner;
class Codechef
{
public static void main (String[] args)
{
Scanner read = new Scanner(System.in);
int t = read.nextInt();
for(int i=0; i<t; i++)
{
int x = read.nextInt();
int y = read.nextInt();
}
}
}
Learning course: Solve Programming problems using Java
Problem Link: CodeChef: Practical coding for everyone
I can’t understand from where I need to start to solve…
@sahil_2701
The logic is the absolute difference of the ceiling division of x and y by 10
can u send me the code of this problem…
// Update the code below to solve this problem
import java.util.Scanner;
import java.lang.Math;
class Codechef
{
public static void main (String[] args)
{
Scanner read = new Scanner(System.in);
int t = read.nextInt();
for(int i=0; i<t; i++)
{
int x = read.nextInt();
int y = read.nextInt();
double x1=Math.ceil((double)x/10);
double y1=Math.ceil((double)y/(double)10);
x=(int)x1;
y=(int)y1;
System.out.println(Math.abs(x-y));
}
}
}