- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
Latest commit
26 lines (24 loc) · 619 Bytes
/
Copy pathMain.java
File metadata and controls
26 lines (24 loc) · 619 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
26
importjava.io.*;
importjava.util.*;
classMain {
publicstaticvoidmain(String[] args) throwsIOException {
// 입력:
Scannerscan = newScanner(System.in);
inta = scan.nextInt();
intb = scan.nextInt();
intc = scan.nextInt();
intsum = 0;
for(inti = a; i <= b; i++){
intcount = 0;
for(intj = 1; j <= c; j++){
if(i % j == 0) {
count++;
}
}
if (count == 2){
sum += i;
}
}
System.out.println(sum);
}
}