import java.util.Scanner;
import java.math.BigInteger;
class Main {
public static void main(String[] args){
Scanner in=new Scanner(System.in);
while(in.hasNext()){
BigInteger x=in.nextBigInteger(),d;
if(x.equals(BigInteger.ZERO)){
return;
}
d=x.mod(BigInteger.TEN);
x=x.subtract((x.divide(BigInteger.TEN)).subtract(d.multiply(BigInteger.valueOf(5))));
if(x.mod(BigInteger.valueOf(17))==BigInteger.ZERO)
System.out.println(1);
else
System.out.println(0);
}
}
}
import java.math.BigInteger;
class Main {
public static void main(String[] args){
Scanner in=new Scanner(System.in);
while(in.hasNext()){
BigInteger x=in.nextBigInteger(),d;
if(x.equals(BigInteger.ZERO)){
return;
}
d=x.mod(BigInteger.TEN);
x=x.subtract((x.divide(BigInteger.TEN)).subtract(d.multiply(BigInteger.valueOf(5))));
if(x.mod(BigInteger.valueOf(17))==BigInteger.ZERO)
System.out.println(1);
else
System.out.println(0);
}
}
}
Comments
Post a Comment