import java.util.Scanner; publicclass Main { publicstaticvoid main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { // 判斷是否結束 int num = in.nextInt();// 讀入整數 } }
}
import java.util.Scanner; publicclass Main { publicstaticvoid main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int n = sc.nextInt(); for (int i = 0; i < n; i++) { double a = sc.nextDouble(); } } }
}
import java.util.Scanner; publicclass Main { publicstaticvoid main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i = 0; i < n; i++) { String str = sc.next(); } }
} import java.util.Scanner; publicclass Main { publicstaticvoid main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine()); for (int i = 0; i < n; i++) { String str = sc.nextLine(); } }
}
import java.util.Scanner; publicclass Main { publicstaticvoid main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine()); for (int i = 0; i < n; i++) { String str = sc.nextLine(); } }
}
import java.util.Scanner; publicclass Main { publicstaticvoid main(String[] args) { NumberFormat formatter = new DecimalFormat("000000"); String s = formatter.format(-1234.567); // -001235 System.out.println(s); formatter = new DecimalFormat("##"); s = formatter.format(-1234.567); // -1235 System.out.println(s); s = formatter.format(0); // 0 System.out.println(s); formatter = new DecimalFormat("##00"); s = formatter.format(0); // 00 System.out.println(s); formatter = new DecimalFormat(".00"); s = formatter.format(-.567); // -.57 System.out.println(s); formatter = new DecimalFormat("0.00"); s = formatter.format(-.567); // -0.57 System.out.println(s); formatter = new DecimalFormat("#.#"); s = formatter.format(-1234.567); // -1234.6 System.out.println(s); formatter = new DecimalFormat("#.######"); s = formatter.format(-1234.567); // -1234.567 System.out.println(s); formatter = new DecimalFormat(".######"); s = formatter.format(-1234.567); // -1234.567 System.out.println(s); formatter = new DecimalFormat("#.000000"); s = formatter.format(-1234.567); // -1234.567000 System.out.println(s); formatter = new DecimalFormat("#,###,###"); s = formatter.format(-1234.567); // -1,235 System.out.println(s); s = formatter.format(-1234567.890); // -1,234,568 System.out.println(s); // The ; symbol is used to specify an alternate pattern for negative // values formatter = new DecimalFormat("#;(#) "); s = formatter.format(-1234.567); // (1235) System.out.println(s); // The ' symbol is used to quote literal symbols formatter = new DecimalFormat(" '# '# "); s = formatter.format(-1234.567); // -#1235 System.out.println(s); formatter = new DecimalFormat(" 'abc '# "); s = formatter.format(-1234.567); // - abc 1235 System.out.println(s); formatter = new DecimalFormat("#.##%"); s = formatter.format(-12.5678987); System.out.println(s); }
}
import java.io.BufferedInputStream;
import java.math.BigInteger;
import java.util.Scanner;
publicclass Main {
publicstaticvoid main(String[] args) {
Scanner cin = new Scanner (new BufferedInputStream(System.in)); int a = 123, b = 456, c = 7890; BigInteger x, y, z, ans; x = BigInteger.valueOf(a); y = BigInteger.valueOf(b); z = BigInteger.valueOf(c); ans = x.add(y); System.out.println(ans); ans = z.divide(y); System.out.println(ans); ans = x.mod(z); System.out.println(ans); if (ans.compareTo(x) == 0) System.out.println("1"); }
}