Help me in solving GDTURN problem

My issue

i am using while (t–) where t is an int but an error is arising which says that cannot convert int to boolean

My code

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
	public static void main (String[] args) throws java.lang.Exception
      Scanner sc = new Scanner(;
      int  t = 5;
      int X = sc.nextInt();
      int Y = sc.nextInt();
     { System.out.println("no");

Problem Link: GDTURN Problem - CodeChef


I am not that well versed with Java - so i checked out another submission - CodeChef: Practical coding for everyone

The while loop implementation you had was incorrect. Apparently Java does not support decrement operator for while - it needs a boolean value.
Replace with - while(t–>0) - should work.

There was also an issue with your Scanner sc = new Scanner(; syntax.
You will need to import the necessary libraries - ‘java.util’ for this to work.