fork(2) download
  1. /* Write a program that reads a string, and then outputs the string without its middle character when the length is odd, and without the middle 2 characters when the length is even.
  2. */
  3.  
  4. import java.util.*;
  5. class Main {
  6. public static void main(String[] args) {
  7. Scanner sc = new Scanner(System.in);
  8. String word = sc.next();
  9. int length = word.length();
  10. if (length % 2 == 1) {
  11. String nnn = word.substring(length/2,length-length/2);
  12.  
  13. //System.out.println(nnn);
  14. } else {
  15.  
  16. }
  17.  
  18. }
  19. }
  20. как вырезать буквы которые находятся вне range?
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:20: error: class, interface, or enum expected
??? ???????? ????? ??????? ????????? ??? range?
^
1 error
stdout
Standard output is empty