- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask350.java
More file actions
Latest commit
20 lines (18 loc) · 552 Bytes
/
Copy pathTask350.java
File metadata and controls
20 lines (18 loc) · 552 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
importjava.util.Scanner;
publicclassTask350 {
publicstaticvoidmain(String[] args) {
Scannerscan = newScanner(System.in);
inta = scan.nextInt();
intb = scan.nextInt();
intc = scan.nextInt();
intd = scan.nextInt();
inte = scan.nextInt();
intres = 0;
for (intx = 0; x < 1001; x++) {
if ((a * Math.pow(x, 3) + b * Math.pow(x, 2) + c * Math.pow(x, 1) + d) / (x - e) == 0) {
res++;
}
}
System.out.print(res);
}
}