Package

Source Code of Reader

import java.util.Scanner;

import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.FileWriter;

public class Reader
{
  public static void main(String[] args) throws IOException
  {
    FileReader fr = new FileReader("input.txt");
    Scanner scanner = new Scanner(fr);
   
    FileWriter fw = new FileWriter("output.txt");
    PrintWriter output = new PrintWriter(fw);
   
   
    while (scanner.hasNext())
    {
      scanner.next();
      double type = scanner.nextDouble();
      scanner.next();
      double level = scanner.nextDouble();
      scanner.next();
      double attack = scanner.nextDouble();
      scanner.next();
      double defense = scanner.nextDouble();
      scanner.next();
      double base = scanner.nextDouble();
      scanner.next();
      double stab = scanner.nextDouble();
      scanner.next();
      double critical = scanner.nextDouble();
      scanner.next();
      double random = scanner.nextDouble();
     
      int damage = (int)((((2.0 * level + 10) / 250) * (attack/defense) * base + 2)
        * stab * type * critical * random);
       
      output.println(damage);
    }
   
    scanner.close();
    output.close();
  }
}
TOP

Related Classes of Reader

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.