title: Multiply the digits at odd position by 1 and at even position by 3
body: <p>I am doing a question and it wants me to get 12 digits to multiply. If the first digit is odd, it has to multiply by 1 otherwise the digit multiply by 3.My program is working. However, the coding is quite long. May I ask if there is any other method?</p>
  
  <pre><code>import java.util.Scanner;
  public class ass2a
  {
      public static void main(String []args)
      {
          Scanner reader = new Scanner(System.in);
          String input,b;
          long checked;
          System.out.print("Please enter the 12 digit:");
          input = reader.nextLine();
  
          long one,two,three,four,five,six,seven,eight,nine,ten,eleven,twevle;
       checked =Long.parseLong(input);
  
        one= checked / 100000000000L;
        two = (checked % 100000000000L)/10000000000L;
        three =(checked % 10000000000L)/ 1000000000L; 
  
        System.out.println(one);
          System.out.println(two);
           System.out.println(three);
  
          if((input.length() &lt; 12) || (input.length() &gt; 12))
         {
              System.out.println("The entered digits is not equal to 12.");
            System.exit(0); 
          }
        else
        {
             System.out.println("Calculating...");
          }
         if (one % 2 ==0) 
        {
            one = one * 1;
          }
         else
         {
            one = one * 3;
            System.out.println("one is "+one);
          }
             if (two % 2 ==0)
        {
            two = two * 1;
          }
          else 
          {
  
              two = two * 3;
               System.out.println("two is "+two);
          }
           if (three % 2 ==0)
        {
            three = three * 1;
          }
          else 
          {
  
              three = three * 3;
               System.out.println("three is "+three);
          }
          System.out.println(one);
          System.out.println(two);
           System.out.println(three);
          long sum = one +two+three;
            System.out.println(sum);
      }
  }
  </code></pre>