Go to diff to previous submission
import java.util.HashSet; import java.util.Scanner; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author kajanek6 */ public class Fl { HashSet<Integer> mnozina=new HashSet<Integer>(); int n=0; int counter=0; int y=0; while (input.hasNextLine()) { counter=0; if(temp.length()==0){ continue; } for(int i=1;i<=10000;i++) { if((i-n)>0){ int vysl = (n*i)/(i-n); int zvysok=(n*i)%(i-n); if(vysl>0 && zvysok==0) { if(!mnozina.contains(i)){ counter++; mnozina.add(i); mnozina.add(vysl); } } } } } } public class pair{ public int prvy; public int druhy; public pair(int a,int b){ prvy=a; druhy=b; } } }
--- c5.s732.cteam087.fl.java.0.Fl.java +++ c5.s746.cteam087.fl.java.0.Fl.java @@ -24,5 +24,7 @@ counter=0; String temp = input.nextLine(); - if(temp.length()<2){break;} + if(temp.length()==0){ + continue; + } n=Integer.parseInt(temp.substring(2)); for(int i=1;i<=10000;i++)