-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCCC03S1.java
More file actions
50 lines (47 loc) · 1.13 KB
/
CCC03S1.java
File metadata and controls
50 lines (47 loc) · 1.13 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
39
40
41
42
43
44
45
46
47
48
49
50
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = 1;
while(true){
int addend = in.nextInt();
if(n+addend>100){
n=n;
System.out.println("You are now on square "+n);
}
if(n+addend<100&&addend<=12&&addend>=2){
n=n+addend;
if(n==54){
n=19;
}
if(n==90){
n=48;
}
if(n==99){
n=77;
}
if(n==9){
n=34;
}
if(n==40){
n=64;
}
if(n==67){
n=86;
}
System.out.println("You are now on square "+n);
continue;
}
if(n+addend==100&&addend<=12&&addend>=2){
System.out.println("You are now on square 100");
System.out.println("You Win!");
break;
}
if(addend==0){
System.out.println("You Quit!");
break;
}
}
}
}