Program.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package zlomky;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author kormanec4
*/
class Program {
private Scanner sc;
private ArrayList
<Integer
> vysledky
= new ArrayList(); public Program() {
while (sc.hasNext()) {
int cislo
= Integer.
parseInt(sc.
nextLine().
substring(2)); int pocRieseni=0;
for(int x=cislo+1;x<=2*cislo;x++){
double y = (cislo*x)/(x-cislo);
if(cislo==(x*y)/(x+y))pocRieseni++;
}
vysledky.add(pocRieseni);
}
}
}
}
Zlomky.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package zlomky;
/**
*
* @author kormanec4
*/
public class Zlomky {
/**
* @param args the command line arguments
*/
public static void main
(String[] args
) { new Program();
}
}