Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.math.*;
- public class Prog {
- public static void main(String[] args) {
- Prog Progr = new Prog();
- Progr.aprekins();
- }
- public double y = 0;
- public double z = 0;
- public void aprekins(){
- for(double x=-2; x<23; x++){
- if(x<2){
- y = Math.sqrt(x-5);
- z = x/y;
- System.out.println("Ja X ir: " + x);
- System.out.println("Tad Y ir:" +y);
- System.out.println("Tad Z ir:" +z);
- System.out.println("---Nakamais---");
- y = 0;
- z = 0;
- }else
- if(x>2){
- y = 25/(x+5);
- z = x/y;
- System.out.println("Ja X ir: " + x);
- System.out.println("Tad Y ir:" +y);
- System.out.println("Tad Z ir:" +z);
- System.out.println("---Nakamais---");
- y = 0;
- z = 0;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement