Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Task15 {
- public static void main(String[] args) {
- double[] array = {7.13, 0.2, 4.9, 5.1, 6.34, 1.12};
- double[] alphaArr = new double[3];
- for(int i=0; i < alphaArr.length; i++){
- for(int row=0; row < array.length; row++){
- if(i == 0) {
- if(array[row] > alphaArr[i]){
- alphaArr[i] = array[row];
- }
- }
- else {
- if(array[row] == alphaArr[0] || array[row] == alphaArr[1]) {
- row++;
- }
- if(array[row] > alphaArr[i] ){
- alphaArr[i] = array[row];
- }
- }
- }
- }
- for(int row = 0; row < alphaArr.length; row++) {
- if(row==0)
- System.out.print(alphaArr[row]);
- else
- System.out.print("; "+alphaArr[row]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement