-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathMain.java
More file actions
36 lines (24 loc) · 689 Bytes
/
Main.java
File metadata and controls
36 lines (24 loc) · 689 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
27
28
29
30
31
32
33
34
35
import java.util.Scanner;
public class Main {
private static final ISubscriber subscribers [] = {
new SimpleSubscriber(),
new ReallySimpleSubscriber(),
new CircleCircumference(),
new SphereVolume(),
new SummationSeries(),
new MultiplicationSeries(),
new LucasSeries()
};
public static void main(String[] args) {
Topic mathTopic = new Topic();
for (ISubscriber sub : subscribers) {
mathTopic.addSubscriber(sub);
}
Scanner sc = new Scanner(System.in);
String input = sc.next();
mathTopic.dispatchEvent(input);
LucasSeries lucasSeries = new LucasSeries();
int x = sc.nextInt();
lucasSeries.fibonacci(x);
}
}