import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Zapping {
public static void main(String[] args) throws Exception {
Reader.init(System.in);
// Reader.init(new FileInputStream(new File("input.in")));
int a = Reader.nextInt();
int b = Reader.nextInt();
int val;
while(a >= 0 && b >= 0) {
val = Math.abs(a - b);
if(val > 50) val = 100 - val;
System.out.println(val);
a = Reader.nextInt();
b = Reader.nextInt();
}
}
}
///** Class for buffered reading int and double values */
///** http://www.cpe.ku.ac.th/~jim/java-io.html */
class Reader {
static BufferedReader reader;
static StringTokenizer tokenizer;
/** call this method to initialize reader for InputStream */
static void init(InputStream input) {
reader = new BufferedReader(new InputStreamReader(input));
tokenizer = new StringTokenizer("");
}
/** get next word */
static String next() throws IOException {
while ( ! tokenizer.hasMoreTokens() ) {
//TODO add check for eof if necessary
tokenizer = new StringTokenizer(reader.readLine());
}
return tokenizer.nextToken();
}
static int nextInt() throws IOException {
return Integer.parseInt( next() );
}
static double nextDouble() throws IOException {
return Double.parseDouble( next() );
}
}
11/08/2013
12468 - Zapping - Java
Subscribe to:
Post Comments (Atom)
Q: Why don't jokes work in octal?
ReplyDeleteA: Because 7 10 11.