Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Duplicate in string
//Title of this code //'main' method must be in a class 'Rextester'. public class Rextester { public void printTwoMaxNumbers(int[] nums){ int maxOne = 0; int maxTwo = 0; for(int n:nums){ if(maxOne < n){ maxTwo = maxOne; maxOne =n; } else if(maxTwo < n){ maxTwo = n; } } System.out.println("First Max Number: "+maxOne); System.out.println("Second Max Number: "+maxTwo); } public static void main(String a[]){ int num[] = {5,34,78,2,45,1,99,23}; Rextester tmn = new Rextester(); tmn.printTwoMaxNumbers(num); } }
run
|
edit
|
history
|
help
0
1
Leetcode 937. Reorder Log Files๐ฎ๐ณ๐ฎ๐ณ๐ฎ๐ณ
Copy an array elments into another array
add
3e
VENU DEVELOPMENTS
Memory cleanup
Area of the triangle
piglatin
classwork