Untitled
unknown
plain_text
2 years ago
309 B
10
Indexable
public class veeru1 {
public static void main(String[] args){
int entering[]={7,0,5,1,13};
int leaving[]={1,2,1,3,4};
int hr=5;
int max=0;
int tmp=0;
for(int i =0;i<hr;i++){
tmp=(tmp+entering[i])-leaving[i];
if(tmp>max)max=tmp;
}
System.out.println(max);
}
}
Editor is loading...