Advertisement
ejdier

sprawdzian

Dec 18th, 2014
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.68 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 javaapplication1;
  7.  
  8. import java.util.Scanner;
  9.  
  10. /**
  11.  *
  12.  * @author Prezes Adrian
  13.  */
  14. public class JavaApplication1 {
  15.  
  16.     /**
  17.      * @param args the command line arguments
  18.      */
  19.     public static void main(String[] args) {
  20.         // TODO code application logic here
  21.         System.out.println("Podaj numer zadania:");
  22.         Scanner input = new Scanner(System.in);
  23.         int z;
  24.         z =input.nextInt();
  25.         switch (z){
  26.             case 1:
  27.         System.out.println("Podaj trzy liczby:");
  28.         int a,b,c;
  29.         a = input.nextInt();
  30.         b = input.nextInt();
  31.         c = input.nextInt();
  32.         if (a==b) System.out.println("Te odcinki mogą tworzyć trójkąt równoramienny");  
  33.         else if(a==c) System.out.println("Te odcinki mogą tworzyć trójkąt równoramienny");
  34.         else if(b==c) System.out.println("Te odcinki mogą tworzyć trójkąt równoramienny");
  35.         else System.out.print("Podane odcinki nie mogą tworzyć trójkąta równoramiennego.");
  36.            case 2:
  37.          
  38.                 for (int i=1; i<=200;i++)
  39.                   { if (i%3==0 & i%4==0) System.out.println("Liczby to:" + i);
  40.                 };
  41.            case 3:
  42.            int tablica[]= new int[9];
  43.            for (int i=1; i<12; i++){
  44.                if (i%2==0) System.out.println("Otrzymane podzielne przez 2: "+ i);
  45.                 if (i%3==0) System.out.println("Otrzymane podzielne przez 3: " + i);
  46.            
  47.            }
  48.                
  49.     }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement