Package java.util

Examples of java.util.Scanner.nextLong()


    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


    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

    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

    String results = null;
    try {
      new Count(new String[]{path}, 0, conf).runAll();
      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 {
      new Count(new String[]{path}, 0, conf).runAll();
      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

    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 inputFile = null;
   
    try{
      inputFile = new Scanner(new FileInputStream(f)); //open file
      while(inputFile.hasNextLong()){ //read numbers
        long serialNum = inputFile.nextLong();
        System.out.println("Searching for " + serialNum);
        if(list.contains(serialNum, true)){ //conduct search
          System.out.println("We found the Serial Number: " + serialNum + ".");
        } else {
          System.out.println("Sorry we were not able to find the Serial Number: " + serialNum + ".");
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.