- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask341.java
More file actions
Latest commit
25 lines (21 loc) · 552 Bytes
/
Copy pathTask341.java
File metadata and controls
25 lines (21 loc) · 552 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
importjava.util.Scanner;
publicclassTask341 {
publicstaticvoidmain(String[]args) {
Scanners = newScanner(System.in);
intn = s.nextInt();
intres = 1;
if (n != 1) {
for (inti = 2; i < Math.sqrt(n); i++) {
if (n % i == 0) {
res++;
}
}
if (n % (int) Math.sqrt(n) == 0) {
res = res * 2 + 1;
} else {
res *= 2;
}
}
System.out.println(res);
}
}