SHARE
TWEET

Задача 7,3

NikolayPresolski Dec 15th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package Java1program;
  2. import java.util.Arrays;
  3. import java.util.Scanner;
  4.  
  5. public class Sedem_tri {
  6.     public static void main(String[] args) {
  7.         String[] alphabet = new String[] {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p",
  8.                 "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
  9.         Scanner sc = new Scanner(System.in);
  10.         String line = sc.nextLine().toLowerCase();
  11.         String lineArgs[]=line.split("");
  12.         for (int i = 0; i < lineArgs.length ; i++) {
  13.             System.out.println(lineArgs[i]+" -> "+Arrays.asList(alphabet).indexOf(lineArgs[i]));
  14.         }
  15.     }
  16.  
  17.  
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top