fork download
  1. public class Main {
  2. public static void main(String[] args) {
  3. double A = 0.0, B = 2.0, dx = 0.2;
  4. System.out.println("--- For-To-Do ---");
  5. for (double x = A; x <= B + 1e-9; x += dx) {
  6. double y = Math.atan(x) + Math.atan((1 - x) / (1 + x));
  7. System.out.printf("x: %.2f | y: %.4f%n", x, y);
  8. }
  9. }
  10. }
Success #stdin #stdout 0.13s 56320KB
stdin
Standard input is empty
stdout
--- For-To-Do ---
x: 0.00 | y: 0.7854
x: 0.20 | y: 0.7854
x: 0.40 | y: 0.7854
x: 0.60 | y: 0.7854
x: 0.80 | y: 0.7854
x: 1.00 | y: 0.7854
x: 1.20 | y: 0.7854
x: 1.40 | y: 0.7854
x: 1.60 | y: 0.7854
x: 1.80 | y: 0.7854
x: 2.00 | y: 0.7854