Advertisement
Guest User

Untitled

a guest
Jul 14th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class first
  4. {
  5.         private static char equation = '1';
  6.         static boolean matchFound = false;
  7.        
  8.         public static void main(String[] args)
  9.         {
  10.                 checkInt();
  11.         }
  12.        
  13.         public static void checkInt()
  14.         {
  15.                 char[] numbers = {'1','2','3','4','5','6','7','8','9','0'};
  16.                 String[] szNumbers = new String[numbers.length];
  17.                
  18.                 for(int i = 0; i < numbers.length; i++)
  19.                 {
  20.                     String szEquation =  Character.toString(equation);
  21.                     szNumbers[i] = Character.toString(numbers[i]);
  22.                    
  23.                     if(szNumbers[i].equals(szEquation))
  24.                     {
  25.                         System.out.println("yes");
  26.                         matchFound = true;
  27.                         break;
  28.                     }
  29.                 }
  30.                 if(!matchFound)
  31.                     System.out.println("no");
  32.         }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement