Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Majors
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' import java.util.*; import java.lang.*; class Rextester { public static void main(String[] args) { int arr[] = {0, -1, 3, 1, 2, 3, -4, 2, 6}; int count = 0; int mount =0; int ans; for (int i = 0; i < arr.length; i++) { if (arr[i] > 0) { count++; } else { count = 0; } if (count > mount) { mount = count; } } ans = mount; System.out.println(ans); } }
run
|
edit
|
history
|
help
0
kochergina_3
Using Recursion reverse the Line
Hi
Basic
JAVA # Günlük Maaş Hesaplama
Opr
post decrement
test
JAVA # EN UZUN CÜMLEYİ EKRANA YAZDIRMA
collectors and stream