Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.lang.*;
- import java.util.*;
- public class examFibonacci{
- public static void main(String[] args) {
- int max1 = 0, max2 = 0, max3 = 0;
- int[] a = new int[]{12,64,23,68,13,69,99,11,5,7,100,32,70};
- for(int i = 0; i < a.length; i++){
- if(max1< a[i]){
- max3 = max2;
- max2 = max1;
- max1 = a[i];
- }
- else if(max2 < a[i]){
- max3 = max2;
- max2 = a[i];
- }
- else if(max3 < a[i])
- max3 = a[i];
- }
- System.out.println("Phan tu lon nhat: " + max1 + "\nPhan tu lon thu 2: " +
- max2 + "\nPhan tu lon thu 3: " + max3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement