Skip to content

Instantly share code, notes, and snippets.

@mizushou
Created October 8, 2017 17:32
Show Gist options
  • Save mizushou/29847230b49bc8219be8919931e9f3a6 to your computer and use it in GitHub Desktop.
Save mizushou/29847230b49bc8219be8919931e9f3a6 to your computer and use it in GitHub Desktop.
CODE FESTIVAL 2017 qual B 問題A
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));
}
}
@mizushou
Copy link
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