Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapplication1;
- import java.util.Scanner;
- /**
- *
- * @author Prezes Adrian
- */
- public class JavaApplication1 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- System.out.println("Podaj numer zadania:");
- Scanner input = new Scanner(System.in);
- int z;
- z =input.nextInt();
- switch (z){
- case 1:
- System.out.println("Podaj trzy liczby:");
- int a,b,c;
- a = input.nextInt();
- b = input.nextInt();
- c = input.nextInt();
- if (a==b) System.out.println("Te odcinki mogą tworzyć trójkąt równoramienny");
- else if(a==c) System.out.println("Te odcinki mogą tworzyć trójkąt równoramienny");
- else if(b==c) System.out.println("Te odcinki mogą tworzyć trójkąt równoramienny");
- else System.out.print("Podane odcinki nie mogą tworzyć trójkąta równoramiennego.");
- case 2:
- for (int i=1; i<=200;i++)
- { if (i%3==0 & i%4==0) System.out.println("Liczby to:" + i);
- };
- case 3:
- int tablica[]= new int[9];
- for (int i=1; i<12; i++){
- if (i%2==0) System.out.println("Otrzymane podzielne przez 2: "+ i);
- if (i%3==0) System.out.println("Otrzymane podzielne przez 3: " + i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement