-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFun49.java
More file actions
38 lines (37 loc) · 1.01 KB
/
Fun49.java
File metadata and controls
38 lines (37 loc) · 1.01 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
package fun;
public class Fun49 {
public static void main(String[] args) {
EKUB (8, 16, 24);
}
public static void EKUB(int a, int b, int c) {//24 va 18
int max = Integer.MIN_VALUE;//-2.000.000.
int t, m = 0, e = 0;
int tb, mb = 0;
int tc, mc = 0;
for (int i = 1; i <= a; i++) {
t = a % i;//24%3=0
if ( t == 0 ) {
m = i;
}
for (int j = 1; j <= b; j++) {
tb = b % j;//
if ( tb == 0 ) {
mb = j;
}
for (int k = 1; k <= c; k++) {
tc = c % k;
if ( tc == 0 ) {
mc = k;
}
if ( m == mb && mb == mc ) {
e = m;
}
if ( max < e ) {
max = e;
}
}
}
}
System.out.println (max);
}
}