Blue___
코딩배우는 학생🌎
Blue___
전체 방문자
오늘
어제
  • 코딩배우는 학생🧀 (242)
    • Algorithms (145)
      • BOJ[Java] (107)
      • Programmers[Java] (32)
      • Coding_Contest (3)
    • Web (22)
      • .NET Core C# (2)
      • Java (1)
      • Oracle SQL (7)
      • Web-ProJect (3)
      • Error처리 (1)
      • Web지식 (4)
      • Javascript (1)
      • Vue (3)
    • Git (4)
    • Java_beginner(Repl.it) (55)
      • Auto-Graded-Course(AP CS A) (54)
    • 프로젝트 직딩일기 (3)
    • Hanyang_Assignment (0)
    • 이모저모 (4)
      • 잡담 (1)
      • 2021 오픈소스 컨트리뷰터 아카데미 (1)
      • DDD - 6기! (1)
    • 북리뷰 (1)
      • 리팩토링 2판 (1)
      • 클린코드 (0)

블로그 메뉴

  • 🐰GITHUB
  • ☘️포트폴리오
  • 🌸MBC개발_투표 2022
  • 🍭MBC_APP

공지사항

인기 글

태그

  • 코딩배우는 학생
  • coding
  • repl.it
  • 자바
  • 알고리즘
  • 코딩
  • REPL
  • 코딩배우는학생
  • 프로그래머스
  • algorithm
  • Java tutorial
  • Java
  • 프로그래밍
  • 레플릿
  • programmers
  • java basic
  • auto-graded course
  • AP CS A
  • 백준
  • Bakjoon

최근 댓글

최근 글

티스토리

hELLO
Blue___

코딩배우는 학생🌎

011 - String Methods Practice 2
Java_beginner(Repl.it)/Auto-Graded-Course(AP CS A)

011 - String Methods Practice 2

2019. 11. 26. 20:32

Given three variables:

String str

int start

int end

 

Print out the following string:

 

The substring of (str) from (start) to (end) is (substring from start to end, inclusive)

 

Sample output:

In: lolwut

Start: 2

End: 4

The substring of lolwut from 2 to 4 inclusive is lwu

 

PLEASE NOTE that we are counting the end index in our output!

lolwut

012345


import java.util.Scanner;

class Main {
  public static void main(String[] args) {
  	Scanner inp = new Scanner(System.in);
  	System.out.println("In:");
  	String str = inp.nextLine();
  	System.out.println("Start:");
  	int start = inp.nextInt();
  	System.out.println("End:");
  	int end = inp.nextInt();
    // Don't change the code above! Write your code below
    System.out.println("The substring of "+str+
    " from "+start+" to "+end+" inclusive is "+ str.substring(start,end+1));
  }
}

반응형

'Java_beginner(Repl.it) > Auto-Graded-Course(AP CS A)' 카테고리의 다른 글

016 - Conditional Statement Practice 2  (0) 2019.11.28
015 - Conditional Statement Practice 1  (0) 2019.11.26
010 - String Methods Practice 1  (0) 2019.11.26
009 - String Methods - substring  (0) 2019.11.26
008 - String Methods - indexOf  (0) 2019.11.26
    'Java_beginner(Repl.it)/Auto-Graded-Course(AP CS A)' 카테고리의 다른 글
    • 016 - Conditional Statement Practice 2
    • 015 - Conditional Statement Practice 1
    • 010 - String Methods Practice 1
    • 009 - String Methods - substring
    Blue___
    Blue___
    완전 연소한 불은 재를 남기지않는다 : 코딩배우는학생 🌎

    티스토리툴바