- import java.util.*;
- public class ok {
- public static void main(String[] args) {
- Scanner s=new Scanner(System.in);
- int x;
- float y;
- String str1, str2;
- System.out.println("Please enter a phrase: ");
- str1=s.nextLine();
- System.out.println(str1);
- System.out.println("Please enter a phrase: ");
- str2=s.nextLine();
- System.out.println(str2);
- System.out.print("Please enter a whole number");
- x=s.nextInt();
- System.out.println(x);
- System.out.print("Please enter a decimal number");
- y=s.nextFloat();
- System.out.println(y);
- }
- }
複製代碼 |