Package java.util

Examples of java.util.Scanner.nextLong()


    String results = null;
    try {
      runCmd(shell, "-count", path);
      results = bytes.toString();
      in = new Scanner(results);
      assertEquals(dirs, in.nextLong());
      assertEquals(files, in.nextLong());
    } finally {
      if (in!=null) in.close();
      IOUtils.closeStream(out);
      System.setOut(oldOut);
View Full Code Here


    try {
      runCmd(shell, "-count", path);
      results = bytes.toString();
      in = new Scanner(results);
      assertEquals(dirs, in.nextLong());
      assertEquals(files, in.nextLong());
    } finally {
      if (in!=null) in.close();
      IOUtils.closeStream(out);
      System.setOut(oldOut);
      System.out.println("results:\n" + results);
View Full Code Here

      Scanner sc=new Scanner(System.in);
      int iNumberOfCases=sc.nextInt();
      int iCasesExecuted=0;
      while (iCasesExecuted<iNumberOfCases){
        iCasesExecuted++;
        long lInput=sc.nextLong();
       
        // The result is obtained using the following formula
        // 1+((n(n+1))/2)
        BigInteger objResult=BigInteger.valueOf(lInput+1);
        objResult=objResult.multiply(BigInteger.valueOf(lInput));
View Full Code Here

  }

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    long cases = sc.nextLong();
    for (int i = 0; i < cases; i++) {
      sc.nextLine();
      long r = sc.nextLong();
      long k = sc.nextLong();
      long g = sc.nextLong();
View Full Code Here

    Scanner sc = new Scanner(System.in);
    long cases = sc.nextLong();
    for (int i = 0; i < cases; i++) {
      sc.nextLine();
      long r = sc.nextLong();
      long k = sc.nextLong();
      long g = sc.nextLong();
      sc.nextLine();
      long[] gs = new long[(int) g];
      for (int j = 0; j < g; j++) {
View Full Code Here

    Scanner sc = new Scanner(System.in);
    long cases = sc.nextLong();
    for (int i = 0; i < cases; i++) {
      sc.nextLine();
      long r = sc.nextLong();
      long k = sc.nextLong();
      long g = sc.nextLong();
      sc.nextLine();
      long[] gs = new long[(int) g];
      for (int j = 0; j < g; j++) {
        gs[j] = sc.nextLong();
View Full Code Here

    long cases = sc.nextLong();
    for (int i = 0; i < cases; i++) {
      sc.nextLine();
      long r = sc.nextLong();
      long k = sc.nextLong();
      long g = sc.nextLong();
      sc.nextLine();
      long[] gs = new long[(int) g];
      for (int j = 0; j < g; j++) {
        gs[j] = sc.nextLong();
      }
View Full Code Here

      long k = sc.nextLong();
      long g = sc.nextLong();
      sc.nextLine();
      long[] gs = new long[(int) g];
      for (int j = 0; j < g; j++) {
        gs[j] = sc.nextLong();
      }
      System.out.println(liters(r, k, g, gs));
    }
  }
}
View Full Code Here

    return liters;
  }

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long cases = sc.nextLong();

    for (int i = 0; i < cases; i++) {
      sc.nextLine();
      long r = sc.nextLong();
      long k = sc.nextLong();
View Full Code Here

    Scanner sc = new Scanner(System.in);
    long cases = sc.nextLong();

    for (int i = 0; i < cases; i++) {
      sc.nextLine();
      long r = sc.nextLong();
      long k = sc.nextLong();
      long g = sc.nextLong();
      sc.nextLine();
      long[] gs = new long[(int)g];
      for (int j = 0; j < g; j++) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.