Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. import java.math.*;
  2. public class Prog {
  3.  
  4.  
  5. public static void main(String[] args) {
  6. Prog Progr = new Prog();
  7. Progr.aprekins();
  8.  
  9. }
  10.  
  11. public double y = 0;
  12. public double z = 0;
  13.  
  14.  
  15. public void aprekins(){
  16.  
  17. for(double x=-2; x<23; x++){
  18.  
  19. if(x<2){
  20. y = Math.sqrt(x-5);
  21. z = x/y;
  22. System.out.println("Ja X ir: " + x);
  23. System.out.println("Tad Y ir:" +y);
  24. System.out.println("Tad Z ir:" +z);
  25. System.out.println("---Nakamais---");
  26. y = 0;
  27. z = 0;
  28. }else
  29. if(x>2){
  30. y = 25/(x+5);
  31. z = x/y;
  32. System.out.println("Ja X ir: " + x);
  33. System.out.println("Tad Y ir:" +y);
  34. System.out.println("Tad Z ir:" +z);
  35. System.out.println("---Nakamais---");
  36. y = 0;
  37. z = 0;
  38.  
  39. }
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement