Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- import java.util.Random;
- public class Main {
- public static String everything(String smth, int smth2, int smth3) {
- StringBuilder str = new StringBuilder();
- str.append(smth);
- String res ="";
- for (int i = smth2; i < smth3; i++) {
- res += str.charAt(i);
- }
- return res;
- }
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- String str = in.next();
- int a = in.nextInt();
- int b = in.nextInt();
- String pos = everything(str, a, b);
- System.out.println(pos);
- }
- }
Add Comment
Please, Sign In to add comment