摘要:
通过Scanner类里的hasNext()实现。以下是Example:import java.util.Scanner;;public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); int a, b; while (cin.hasNext()) { a = cin.nextInt(); b = cin.nextInt(); System.out.println(a % b); } }} 也可以参考:http://www.javadocexamples.com 阅读全文