-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
24 lines (17 loc) · 657 Bytes
/
Copy pathMain.java
File metadata and controls
24 lines (17 loc) · 657 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
public class Main {
public static void main(String[] args) {
for (int i = 6; i <= 78; i++) {
try {
String currentAttempt = new UglyNumber((i % 7 == 0)?i+"abcd":i+"").toString();
System.out.println("Number "+currentAttempt +" processed successfully");
} catch (TooPrettyNumberException e)
{
System.out.println("Oops - beauty contest? "+ e.getMessage());
}
catch (Exception e)
{
System.out.println("Strange error occured: "+ e.getClass().getName() +" " + e.getMessage());
}
}
}
}