Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.InputStreamReader;
- public class MatchInteger {
- public static void main(String[] args) {
- int[] password = {22, 33, 44};
- BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
- boolean match = true;
- for (int p: password) {
- try {
- if (p != new Integer(in.readLine())) match = false;
- }
- catch (Exception e) {
- match = false;
- break;
- }
- }
- if (match) System.out.println("一致");
- else System.out.println("不一致");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement