Created
October 8, 2017 17:32
-
-
Save mizushou/29847230b49bc8219be8919931e9f3a6 to your computer and use it in GitHub Desktop.
CODE FESTIVAL 2017 qual B 問題A
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
class Xxfestival { | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
String str = scan.next(); | |
int l =str.length(); | |
System.out.println(str.substring(0, l-8)); | |
} | |
} |
Author
mizushou
commented
Oct 8, 2017
- substringのindexも配列同様、0~n
- 注意点はendのindexの直前の位置までの部分文字列となる
- abcdefで0-2を指定したらabcではなくabになる
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment