123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import java.util.Scanner;
  2. /**
  3. * Created by leon on 2/9/18.
  4. */
  5. public class Console {
  6. /*public static void print(String output, Object... args) {
  7. System.out.printf(output, args);
  8. }
  9. public static void println(String output, Object... args) {
  10. print(output + "\n", args);
  11. }
  12. public static String getStringInput(String prompt) {
  13. Scanner scanner = new Scanner(System.in);
  14. println(prompt);
  15. String userInput = scanner.nextLine();
  16. return userInput;
  17. }
  18. public static int add(int num1,int num2){
  19. return num1 + num2;
  20. }
  21. public static int minus(int num1,int num2){
  22. return num1 - num2;
  23. }
  24. public static int mult(int num1,int num2){
  25. return num1 * num2;
  26. }
  27. public static int pow(double num1,double num2){
  28. double r = Math.pow(num1,num2);
  29. return (int)Math.round(r);
  30. }
  31. public static double squ(int num1){
  32. return (double) Math.sqrt(num1);
  33. }
  34. public static int min(int num1, int num2){
  35. return Math.min(num1,num2);
  36. }
  37. public static int max(int num1, int num2){
  38. return Math.max(num1,num2);
  39. }
  40. public static double exp (double num1){
  41. return Math.pow(2.718,num1);
  42. }
  43. public static double tenthpow(double num1){
  44. return Math.pow(10,num1);
  45. }
  46. public static int abs(int num1){
  47. return Math.abs(num1);
  48. }
  49. public static double round(double num1){
  50. return Math.round(num1);
  51. }
  52. public static long exp (int num1, int num2){
  53. int neg = -2147483647;
  54. int pos = 2147483647;
  55. long t = 0;
  56. if(num1 >= -1 || num1 <= neg){
  57. double re = Math.pow(num1,num2);
  58. return (long)re;
  59. }
  60. else if(num2 >= 1 || num2 <= pos ){
  61. double re2 = Math.pow(num2,num1);
  62. return (long)re2;
  63. }
  64. return t;
  65. }*/
  66. }