Skip to content

Instantly share code, notes, and snippets.

@yuanqing
Created January 22, 2015 10:16
Show Gist options
  • Save yuanqing/b22bb0f34852233c9bb4 to your computer and use it in GitHub Desktop.
Save yuanqing/b22bb0f34852233c9bb4 to your computer and use it in GitHub Desktop.
import java.util.*;
import java.io.*;
class ReadInputByCharacter {
public static void main(String[] args) throws Exception {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
int n;
while ((n = br.read()) != -1) {
char c = (char) n;
System.out.print(c);
}
System.out.println();
br.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment