Untitled

 avatar
unknown
plain_text
4 years ago
576 B
8
Indexable
import java.util.*;
public class Main {
	public static void main (String [] args) {
		Scanner scnr = new Scanner(System.in);
		int userNum = 0;
		userNum = 9;
		long startTime = System.currentTimeMillis(); //fetch starting time
		
		//either usernum is Non Negative or time finished
		//checking if usernum is Non Negative get into the loop.
		while ((System.currentTimeMillis()-startTime)<100000 ) {
			System.out.println("Body");
			userNum = scnr.nextInt();
      if(userNum < 0){
        break;
      }
		}
		System.out.println("Done.");
		return;
	}
}
Editor is loading...