Skip to content

Commit ea0772b

Browse files
committed
Update Intro_CP.mdx
1 parent 2e4effb commit ea0772b

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

content/1_General/Intro_CP.mdx

+13-9
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ Here is a task similar to the one that was solved in Kamil's video:
7777

7878
<FocusProblem problem="general" />
7979

80+
<Info title="Beginners!">
81+
If you have prior programming experience we encourage you to register a Kattis account and submit a solution.
82+
If not, feel free to skip ahead to the solution.
83+
</Info>
84+
8085
<Spoiler title="Solution">
8186

8287
Just print the second-to-last character of the input.
@@ -108,15 +113,14 @@ print(input()[-2])
108113
<JavaSection>
109114

110115
```java
111-
// with Kattio from /general/input-output#java
112-
113-
public class A {
114-
static Kattio io = new Kattio();
115-
public static void main(String[] args) {
116-
String s = io.next();
117-
System.out.println(s.charAt(s.length()-2));
118-
io.close(); // make sure to include this line -- closes io and flushes the output
119-
}
116+
import java.util.Scanner;
117+
118+
public class basketballoneonone {
119+
public static void main(String[] args) {
120+
Scanner in = new Scanner(System.in);
121+
String s = in.next();
122+
System.out.println(s.charAt(s.length()-2));
123+
}
120124
}
121125
```
122126

0 commit comments

Comments
 (0)