Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import java.io.*;
  2. class ASP {
  3. public static void asp(int a[], int b[], int n) {
  4. int i , j;
  5. // First Activity always gets selected
  6. i = 0;
  7. System.out.println(i);
  8. for(j = 1 ; j < n; j++) {
  9. if(a[j] >= b[i]) {
  10. System.out.println(j);
  11. i = j;
  12. }
  13. }
  14. }
  15. public static void main(String[] args) {
  16. int a[] = {1, 3, 0, 5, 8, 5};
  17. int b[] = {2, 4, 6, 7, 9, 9};
  18. int n = a.length;
  19. asp(a, b, n);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement