Advertisement
knugi

Twierdzenie Pitagorasa

Sep 30th, 2014
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. package Twierdzenie;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Pitagorasa
  6. {
  7.  
  8.     public static void main(String[] args)
  9.     {
  10.         System.out.println("Twerdzenie Pitagorasa: \nPodaj liczbę:\n[1] Chce odszukac inna liczbe (Wiedząc, że trójkąt jest prostokątny.\n[2]Chce sprawdzic czy trojkat jest prostokatny.");
  11.         Scanner in = new Scanner(System.in);
  12.         int spr;
  13.         while(true)
  14.         {
  15.             spr = in.nextInt();
  16.             if(spr < 1 || spr > 2)
  17.             {
  18.                 System.out.println("Blad: Nie ma takiej opcji. Sproboj ponownie.");
  19.             }
  20.             else break;
  21.         }
  22.         if(spr == 1)
  23.         {
  24.             System.out.println("(a² + b² = c²)\nPodaj jakie masz dane:");
  25.             String dane1;
  26.             while(true)
  27.             {
  28.                 dane1 = in.nextLine();
  29.                 if()
  30.                 {
  31.                     System.out.println("Nie ma takiej literki (a, b, c)")
  32.                 }
  33.             }
  34.             if(dane1.equalsIgnoreCase("a"))
  35.             {
  36.                 if(dane1.equalsIgnoreCase("b"))
  37.                 {
  38.                     //a² + b²
  39.                     System.out.println("xD");
  40.                 }
  41.             }
  42.         }
  43.     }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement