Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class apples{
- public static void main(String args[]){
- Scanner bucky = new Scanner(System.in);
- String str1;
- String str2[]={"大雄","宜靜","技安"};
- String tele[]={"032125678","02267123456","075534321"};
- System.out.print("請輸入要查詢的對象:");
- str1 = bucky.nextLine();
- for(int i=0;i<str2.length;i++){
- if(str1.equals(str2[i])){
- System.out.println(str2[i] + ": " + tele[i]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement