Code example for Scanner

Methods: nextLong

0
import java.util.Scanner; 
import java.util.Vector; 
 
public class Lab2p2  
{ 
  public static void main(String[] args)
  { 
    /* Citim x si y. */ 
    Scanner inputScanner = new Scanner(System.in);
    long x = inputScanner.nextLong();
    long y = inputScanner.nextLong();
 
    /* Calculam descompunerea in fractii egiptene. */ 
    Vector<Fractie> v = descompunere_fractii_egiptene(x, y);
 
    /* Si o afisam. */ 
    System.out.println(v);
  } 
 
  private static long ceil(long a, long b)
  { 
    return a / b + (a % b > 0 ? 1 : 0); 
  } 
Contextual code suggestions in your IDE  Get Codota for Java