Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class P04ConcatenateData2 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String firstName = scanner.nextLine();
- String lastName = scanner.nextLine();
- int age = Integer.parseInt(scanner.nextLine());
- String city = scanner.nextLine();
- System.out.printf("You are %s %s, a %d-years old person from %s.", firstName, lastName, age, city ) ;
- }
- }
- //import java.util.Scanner;
- //
- //public class Main {
- // public static void main(String[] args) {
- // Scanner scanner = new Scanner(System.in);
- //
- // String firstName = scanner.nextLine();
- // String lastName = scanner.nextLine();
- // int age = Integer.parseInt(scanner.nextLine());
- // String city = scanner.nextLine();
- //
- // System.out.printf("You are %s %s, a %d-years old person from %s.\n", firstName, lastName, age, city ) ;
- // System.out.println();
- // }
- //}
Advertisement
Add Comment
Please, Sign In to add comment