import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
StringBuffer sb = new StringBuffer("");
String m = "";
while(true) {
m=br.readLine();
if("0".equals(m))
break;
BigInteger x=new BigInteger(m);
if(x.remainder(BigInteger.valueOf(11)).compareTo(BigInteger.ZERO)==0){
sb.append(m).append(" is a multiple of 11.\n");
}else{
sb.append(m).append(" is not a multiple of 11.\n");
}
}
System.out.print(sb);
}
}
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
StringBuffer sb = new StringBuffer("");
String m = "";
while(true) {
m=br.readLine();
if("0".equals(m))
break;
BigInteger x=new BigInteger(m);
if(x.remainder(BigInteger.valueOf(11)).compareTo(BigInteger.ZERO)==0){
sb.append(m).append(" is a multiple of 11.\n");
}else{
sb.append(m).append(" is not a multiple of 11.\n");
}
}
System.out.print(sb);
}
}
No comments:
Post a Comment