Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.28 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package repetytorium2;
  7.  
  8. import java.util.Scanner;
  9.  
  10. public class Repetytorium2 {
  11.     public static void main(String[] args){
  12.        
  13.           Scanner sc = new Scanner(System.in);
  14.       double a = sc.nextDouble();
  15.           double b = sc.nextDouble();
  16.           double c = sc.nextDouble();
  17.          
  18.         if ( c*c == (a*a)+(b*b) )
  19.             System.out.println("TAK");
  20.         else if ( b*b == (a*a)+(c*c) )
  21.             System.out.println("TAK");
  22.         else if ( a*a == (c*c)+(b*b) )
  23.             System.out.println("TAK");
  24.         else
  25.             System.out.println("NIE");
  26.        
  27.         System.out.println("Podaj a");
  28.         double a1 = sc.nextDouble();
  29.         System.out.println("Podaj b");
  30.         double b1 = sc.nextDouble();
  31.         System.out.println("Podaj c");
  32.         double c1 = sc.nextDouble();
  33.         System.out.println(a1 +"X" + " + " + b1 + " = " + c1);
  34.         if (a==0)
  35.             System.out.println("X moze byc dowolna liczbą");
  36.         else
  37.             System.out.println("X= " + (c-b)/a));
  38.        
  39.        
  40.     }
  41.    
  42.  
  43.  
  44.        
  45.     }
  46.    
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement