Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class week8 {
- public static void main(String[] args) {
- //Inputs
- Scanner input = new Scanner(System.in);
- System.out.println("Input security code");
- int S = input.nextInt(); //S=Security Code
- int H=1;
- //Process
- int [][] C = { //C=Account Numbers and Security Codes
- {786411, 54},
- {552909, 932},
- {641608, 1408}
- };
- for (int row=0; row < C.length; row++)
- {
- if (S - (C[row][1]) <= 10 && S - (C[row][1]) >= -10)
- {
- H = 2;
- System.out.println("The account number is " + C[row][0]);
- break;
- }
- }
- if (H<2) System.out.println("The Code can be used");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement