Advertisement
CR7CR7

CharsToString

Sep 21st, 2022
1,419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.io.*;
  3. import java.util.*;
  4.  
  5. public class P06CharsToStrings {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         char firstSymbol = scanner.nextLine().charAt(0);
  10.         char secondSymbol = scanner.nextLine().charAt(0);
  11.         char thirdSymbol = scanner.nextLine().charAt(0);
  12.         String result = Character.toString(firstSymbol) + Character.toString(secondSymbol) + Character.toString(thirdSymbol);
  13.  
  14.         System.out.println(result);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement