Created
October 28, 2016 20:06
-
-
Save greensma/41fbf5237a2018c6ea285bd9bee5d0d6 to your computer and use it in GitHub Desktop.
HomeWork3
This file contains 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 Ex1 { | |
public static void main(String[] args) { | |
System.out.printf("Площадь %.2f",geroneSquare(14, 12, 12)); | |
} | |
public static double geroneSquare(double a, double b, double c) { | |
double p = (a + b + c) / 2; | |
return Math.sqrt(p * (p - a) * (p - b) * (p - c)); | |
} | |
} |
This file contains 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
package table; | |
public class Ex2 { | |
public static int[] create(int x){ | |
int[] tablex = new int[9]; | |
for (int i = 1; i<9; i++){ | |
tablex[i] = x * i; | |
tablex[i+1] = i; //12 строка | |
} | |
return tablex; | |
} | |
} |
This file contains 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 Ex4 { | |
public static int min(int a, int b, int c) { | |
a = 5; | |
b = 3; | |
c = 8; | |
if (a < b && a < c) { | |
return a; | |
} else if (b < a && b < c) { | |
return b; | |
} else if (c < a && c < b) { | |
} | |
return c; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment