import java.math.BigInteger;
import java.util.Scanner;
class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
StringBuffer br = new StringBuffer("");
BigInteger bg11 = BigInteger.valueOf(11);
boolean flag = false;
while(true) {
String m = sc.nextLine();
if (m.equalsIgnoreCase("0")) break;
BigInteger bg = new BigInteger(m);
if(bg.compareTo(BigInteger.ZERO)==0) break;
int x =(bg.remainder(bg11)).compareTo(BigInteger.ZERO);
//System.out.println(x);
if(x==0){
br.append(m + " is a multiple of 11.\n");
//System.out.println(bg + " is not a multiple of 11.");
}
else {
br.append(m + " is not a multiple of 11.\n");
}
}
System.out.print(br);
}
}
import java.util.Scanner;
class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
StringBuffer br = new StringBuffer("");
BigInteger bg11 = BigInteger.valueOf(11);
boolean flag = false;
while(true) {
String m = sc.nextLine();
if (m.equalsIgnoreCase("0")) break;
BigInteger bg = new BigInteger(m);
if(bg.compareTo(BigInteger.ZERO)==0) break;
int x =(bg.remainder(bg11)).compareTo(BigInteger.ZERO);
//System.out.println(x);
if(x==0){
br.append(m + " is a multiple of 11.\n");
//System.out.println(bg + " is not a multiple of 11.");
}
else {
br.append(m + " is not a multiple of 11.\n");
}
}
System.out.print(br);
}
}
No comments :
Post a Comment