mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 11:18:16 +07:00
21 lines
466 B
Java
21 lines
466 B
Java
// "Replace Stream API chain with loop" "true"
|
|
|
|
import java.util.stream.IntStream;
|
|
|
|
public class Main {
|
|
private static long check(int start, double val) {
|
|
long count = 0;
|
|
int bound = start * 200;
|
|
for (int x = start; x <= bound; x++) {
|
|
double v = 1.0 / x;
|
|
if (v < val) {
|
|
count++;
|
|
}
|
|
}
|
|
return count;
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(check(2, 0.04));
|
|
}
|
|
} |