1.
/**
* Angewandte Mathematik, SS11
* Problem: 10929 You can say 11
* Link:
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=23&page=show_problem&problem=2113
*
* @author Schramm, Felix
* @author Vogel, Johannes
* @version 1.0, 04/04/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 2.860
*/


import java.io.*;

public class Main {
public static void main(String args[]) throws IOException{
BufferedReader reader = new BufferedReader(new
InputStreamReader(System.in));
boolean terminate = false;

while (!terminate) {
int digit = 0;
int quersumme = 0;
boolean even = false;
String zahl = "";
boolean newNumber = true;
while(digit!=-38){
digit = reader.read()-'0';
if(newNumber&&digit==0){
zahl+=0;
digit = reader.read()-'0';
terminate=digit<0||digit>9;
}
if(digit>=0&&digit<=9){
quersumme+=even?-digit:digit;
zahl+=digit;
even=!even;
newNumber=false;
}
}
if(terminate)
break;
quersumme=even?-quersumme:quersumme;
if(zahl!=""){
System.out.print(zahl+" is");
if(!(quersumme%11==0))
System.out.print(" not");
System.out.println(" a multiple of 11.");
}

}
}
}

2.

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
* Angewandte Mathematik, SS11
* Problem: 10929 - You can say 11
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1870
*
* @author Benedikt Z¨nnchen
* @author Erik Wenzel
* @version 1.0, 03/29/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.524
*/

public class Main
{

/**
* @param args
* @throws IOException
*/
public static void main(String[] args)
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line;
int maxIntLength = 17;
int startIndex;
String sub;
long number;
try
{
while((line = reader.readLine()) != null)
{
if(line.length() == 1 && Integer.parseInt(line) == 0)
{
break;
}
number = 0;
startIndex = 0;
for(int i = maxIntLength; i < line.length()+maxIntLength; i += maxIntLength)
{
if(i>=line.length())
{
sub = line.substring(startIndex, line.length());
}
else
{
sub = line.substring(startIndex, i);
startIndex = i;
}
number = Long.parseLong(number+sub);
number = number%11;
}
if(number == 0)
{
System.out.println(line+" is a multiple of 11.");
}
else
{
System.out.println(line+" is not a multiple of 11.");
}
}
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
try
{
reader.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
}

3.

/**
* Angewandte Mathematik, SS11
* Problem: 10929 - You can say 11
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1870
*
* @author Markus Schöllner
* @author Andreas Maier
* @version 1.0, 03/29/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.184
*/

import java.util.Scanner;

class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int number;

do {
number = scanner.nextInt();
if(number == 0) break;
boolean isPrime = true;
boolean isPerfect = false;
long result=0;

for(int c = 2; c < number; c++) {
if(number%c == 0) isPrime = false;
if(isPrime == false)break;
}
if(isPrime){
isPerfect = true;
result = (int) (Math.pow(2, number)-1);
if(number!=31) {
for(int c = 2; c < result; c++) {
if(result%c == 0) isPerfect = false;
if(isPerfect == false)break;
}
}
if(isPerfect) result = result * (int) (Math.pow(2, number-1));
}
if(isPerfect) System.out.println("Perfect: "+result+"!");
else {
if(isPrime) System.out.println("Given number is prime. But, NO perfect number is available.");
else System.out.println("Given number is NOT prime! NO perfect number is available.");
}
}while(number !=0);
}
}

4.

/**
* Angewandte Mathematik, SS11
* Problem: 10929 You can say 11
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1870
*
* @author Fabian Trampusch
* @author Robert Schwarz
* @version 2.0, 04/04/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.272
*/

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

int sum = 0;
boolean add = true;
int length = 0;

while (true) {
String line = br.readLine();
length = line.length();

if(length == 1 && line.charAt(0) == '0') {
System.exit(0);
}

for (int i = 0; i < length; i++) {
if (add) {
sum += (line.charAt(i) - '0');
} else {
sum -= (line.charAt(i) - '0');
}
add = !add;
}

if (sum % 11 == 0) {
System.out.println(line + " is a multiple of 11.");
} else {
System.out.println(line + " is not a multiple of 11.");
}

sum = 0;
}
} catch (Exception e) {
}
}
}

5.

/**
* Angewandte Mathematik, SS11
* Problem: 10929 You can say 11
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1870
*
* @author Unverzart Michael
* @author Wurth Manuel
* @version 1.0, 03/04/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.404
*/

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class Main
{
public static void main(String args[]) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String inputLine="";
while((inputLine = reader.readLine())!= null)
{
if (inputLine.equals("0")) break;
BigInteger input = new BigInteger(inputLine);
BigInteger tmp = input.mod(BigInteger.valueOf(11));
if(tmp.equals(BigInteger.valueOf(0))) System.out.println(inputLine + " is a multiple of 11.");
else System.out.println(inputLine+ " is not a multiple of 11.");
}
}
}

6.

/**
* Angewandte Mathematik, SS11
* Problem: 10929 You can say 11
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1870
*
* @author Weber Christian
* @author Waldleitner Christoph
* @author Wolff Marco
* @version 1.0, 3/29/2011
*
* Method : Ad-Hoc
* Status : Runtime Error
* Runtime: 0.000
*/


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class YouCanSay11
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
long odd,even;
BigInteger start;

do{
odd = 0;
even = 0;
String input = br.readLine();

if(input == "0")
return;

start = new BigInteger(input);

for(int i=0;i<input.length();i+=2)
{
even += (input.charAt(i)-48);
}
for(int i=1;i<input.length();i+=2)
{
odd += (input.charAt(i)-48);
}

if((even-odd)%11 == 0)
{
System.out.println(start + " is a multiple of 11.");
}
else
{
System.out.println(start + " is not a multiple of 11.");
}
}while(true);
}
}

7.

/**
* Angewandte Mathematik, SS11
* Problem: 10929 You can say 11
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1870
*
* @author Weber Christian
* @author Waldleitner Christoph
* @author Wolff Marco
* @version 1.0, 3/29/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.348
*/


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class YouCanSay11
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
long odd,even;
String input ="";

do{
odd = 0;
even = 0;
input = br.readLine();

if(input.equals("0"))
break;


for(int i=0;i<input.length();i+=2)
{
even += (input.charAt(i)-48);
}
for(int i=1;i<input.length();i+=2)
{
odd += (input.charAt(i)-48);
}

if((even-odd)%11 == 0)
{
System.out.println(input + " is a multiple of 11.");
}
else
{
System.out.println(input + " is not a multiple of 11.");
}
}while(input!="0");

System.exit(0);
}
}

8.
/**
* Angewandte Mathematik, SS11
* Problem: 10929- You can say 11
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1870
*
* @author Benjamin Vogt
* @author Sebastian Stumpf
* @version 1.0, 02/04/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.356
*/

import java.util.*;

public class Main
{
static boolean altQuersum(String numberStr)
{
StringBuilder sb = new StringBuilder (numberStr);
int alterQuersum =0;
int count = 0;
for(int i = sb.length()-1;i>=0 ;i--)
{
alterQuersum += count%2 == 0? (sb.charAt(i) -48): -(sb.charAt(i) - 48);
count++;
}
return alterQuersum%11 == 0;
}

public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
String numberStr = sc.nextLine();
while(numberStr.charAt(0) != '0' || numberStr.length()>1)
{
System.out.println(numberStr+(altQuersum(numberStr)? " is a multiple of 11.": " is not a multiple of 11."));
numberStr = sc.nextLine();
}
}
}

//112233
//30800
//2937
//323455693
//5038297
//112234
//0

-----------------------------------------------------

1.

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, WS10/11
* Problem: 10929 You can say 11
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&page=show_problem&problem=979
*
* @author Anton Pavlushko, IBB7B,
* @version 1.0, 10/10/2010
*
* Status : Accepted
* Runtime: 0.300
*/

import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String current_line = "";
int difference, length, i;

try {
while ((current_line=in.readLine())!= null && !current_line.equals("0")) {
difference = 0;
length=current_line.length();
for(i=0;i<length;i++)
difference+=(i%2==0?1:-1)*Character.getNumericValue(current_line.charAt(i));

if (difference%11==0)
System.out.println(current_line+" is a multiple of 11.");
else
System.out.println(current_line+" is not a multiple of 11.");

} // end while
} // end try
catch (IOException e) {
System.err.println("Error: " + e);
}
}
}