Advertisement
techno-

selectCandidates

Nov 4th, 2022
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. package e2;
  2.  
  3. import java.util.Iterator;
  4.  
  5. public class selectCandidates {
  6.     public static String selectCandidates(TVRealityList TV, int k){
  7.         TV.setK(k);
  8.         Iterator<String> it = TV.iterator();
  9.         String resultado="";
  10.  
  11.         while(it.hasNext()){
  12.             System.out.println("("+it.next()+")");
  13.             it.remove();
  14.         }
  15.         System.out.println("Ganador: " + TV.getLista().get(0));
  16.         resultado=TV.getLista().get(0);
  17.         return resultado;
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement