fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Scanner in = new Scanner(System.in);
  10. double a, b, h;
  11. //cin >> a >> b>> h;
  12. a = in.nextDouble();
  13. b = in.nextDouble();
  14. h = in.nextDouble();
  15. for (double x = a; x <= b; x += h) {
  16. System.out.printf("%.3f %.3f\n", x, 3 * Math.sin(x));
  17. }
  18. }
  19. }
Success #stdin #stdout 0.08s 2184192KB
stdin
1 2 0.5
stdout
1.000 2.524
1.500 2.992
2.000 2.728