Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class first
- {
- private static char equation = '1';
- static boolean matchFound = false;
- public static void main(String[] args)
- {
- checkInt();
- }
- public static void checkInt()
- {
- char[] numbers = {'1','2','3','4','5','6','7','8','9','0'};
- String[] szNumbers = new String[numbers.length];
- for(int i = 0; i < numbers.length; i++)
- {
- String szEquation = Character.toString(equation);
- szNumbers[i] = Character.toString(numbers[i]);
- if(szNumbers[i].equals(szEquation))
- {
- System.out.println("yes");
- matchFound = true;
- break;
- }
- }
- if(!matchFound)
- System.out.println("no");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement