Rewrite Display 2.6 using BufferedReader.
You need to import the following packages in the first place.
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
Change
Scanner keyboard= new Scanner(System.in);
into
BufferedReader keyboard= new BufferedReader(new InputStreamReader(System.in));
String inputString = keyboard.readLine();
ANS
這次的條件把所有的input都變成了string型態
想了很久
還是只能尋找一些method去把string轉換成int來做運算
1 則留言:
Good thinking logic.
張貼留言