This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
printCoordinates("b", "3"); | |
} | |
/** | |
* -=TANKS=- | |
*/ | |
static String getQuadrant(String v, String h) { | |
String str_v = "abcdefghi"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
System.out.println(getQuadrant("a", "1")); | |
} | |
static String getQuadrant(String v, String h) { // means that input data is correct | |
String str_v = "abcdefghi"; | |
return (Integer.valueOf(h) * 64) + "_" + (str_v.indexOf(v) + 1) * 64; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
System.out.println(isSpring(4)); | |
} | |
static int isSpring(int month) { | |
int result = -1; | |
if ((month > 0) && (month <= 12)) { | |
if ((month>=3)&&(month<=5)){ | |
result = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
System.out.println(min(11, 12, 3)); | |
} | |
public static int min(int a, int b, int c) { | |
int min = a; | |
if (b < a) { | |
min = b; | |
} else if (c < a) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
System.out.println(min(14, 112, 13)); | |
} | |
public static int min(int a, int b, int c) { | |
int min = a; | |
if ((b<a)&&(b<c)) { | |
min = b; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
System.out.println(oldEnogh(2123)); | |
} | |
static boolean oldEnogh(int age) { | |
if (age >= 21) { | |
return true; | |
} else | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
System.out.println(square(4)); | |
} | |
static double square(double number) { | |
return (number * number); | |
} | |
static double square(int number){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
System.out.println(square(4)); | |
} | |
private static double square(double number) { | |
return (number * number); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
sum(1,4); | |
} | |
private static void sum(int num1,int num2){ | |
System.out.println(num1 + num2); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
System.out.println(hello("Valera")); | |
} | |
private static String hello(String name){ | |
return "Hello " + name; | |
} | |
} |