We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58af1f5 commit 1e35425Copy full SHA for 1e35425
Kattis/TouchDown/Main22.java
@@ -0,0 +1,39 @@
1
+import java.util.Scanner;
2
+
3
+/**
4
+ * Created by AMK on 7/25/2019.
5
+ * Life is nice :)
6
+ * Enjoy coding :D
7
+ */
8
+public class Main22 {
9
+ public static void main(String[] args) {
10
+ Scanner scanner = new Scanner(System.in);
11
+ int n = scanner.nextInt();
12
+ int pos = 20;
13
+ int sum = 0;
14
+ int rem = 4;
15
+ for (int i = 0; i < n; i++) {
16
+ int x = scanner.nextInt();
17
+ sum += x;
18
+ pos += x;
19
+ if (sum < 10){
20
+ rem--;
21
+ }else{
22
+ rem = 4;
23
+ sum = 0;
24
+ }
25
+ if (rem == 0) {
26
+ System.out.println("Nothing");
27
+ return;
28
29
+ if (pos >= 100){
30
+ System.out.println("Touchdown");
31
32
+ }else if (pos <= 0){
33
+ System.out.println("Safety");
34
35
36
37
38
39
+}
0 commit comments