Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.InputStreamReader;
- import java.io.InputStream;
- import java.nio.CharBuffer;
- import java.io.IOException;
- import java.io.UnsupportedEncodingException;
- import java.lang.StringBuilder;
- import java.lang.String;
- import java.io.*;
- public class FastScanner {
- private InputStreamReader in;
- private String buffer;
- private int readerPtr;
- public FastScanner(InputStream stream, String enccoding) throws UnsupportedEncodingException {
- in = new InputStreamReader(stream, enccoding);
- buffer = "";
- readerPtr = 0;
- }
- public void fflush() {
- buffer = "";
- readerPtr = 0;
- }
- public boolean hasNextInt()
- {
- if (readerPtr != buffer.length())
- return true;
- fflush();
- char a = 'a';
- boolean flag = false;
- while (!Character.isWhitespace(a))
- {
- try
- {
- a = (char)in.read();
- if (Character.isWhitespace(a))
- if (flag)
- return true;
- else
- return false;
- buffer += a;
- flag = true;
- } catch (IOException e)
- {
- e.printStackTrace();
- return false;
- }
- }
- return true;
- }
- public int nextInt()
- {
- return Integer.parseInt(buffer);
- }
- /*public boolean hasNextLine() throws IOException {
- return hasNext();
- }
- public String nextLine() throws IOException {
- StringBuilder result = new StringBuilder("");
- while (hasNext()) {
- char ch = next();
- if (ch == '\n')
- break;
- result.append(ch);
- }
- return result.toString();
- }
- public void close() {
- try {
- in.close();
- } catch (IOException e) {
- System.err.println("Scanner is not closed");
- }
- }*/
- }
- public class Main
- {
- public static void main(String[] args) {
- FastScanner fs = new FastScanner(System.in,"KOI8-R");
- while (fs.hasNextInt())
- System.out.println(fs.nextInt() * 10);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement