Computer Programming Contest Preparation

ToolBox - Source for: 109/10929/a10929.java



/home/toolbox/public_html/solutions/109/10929/a10929.java
    1 import java.util.Scanner;
    2 import java.math.BigInteger;
    3 
    4 class a10929
    5 {
    6     public static void main(String[] args)
    7     {
    8         BigInteger eleven = BigInteger.valueOf(11);
    9         BigInteger zero = BigInteger.valueOf(0);
   10         BigInteger tmp = BigInteger.valueOf(0);
   11 
   12         Scanner sc = new Scanner(System.in);
   13         BigInteger num = sc.nextBigInteger();
   14         while (! num.equals(zero))
   15             {
   16                 // while
   17                 System.out.print(num);
   18                 tmp = num.mod(eleven);
   19                 if (tmp.equals(zero))
   20                     {
   21                         // 11 does divide
   22                         System.out.println(" is a multiple of 11.");
   23                     } // 11 does divide
   24                 else
   25                     {
   26                         // 11 does NOT divide
   27                         System.out.println(" is not a multiple of 11.");
   28                     } // 11 does NOT divide
   29                 num = sc.nextBigInteger();
   30             } // while
   31     }
   32 }
   33