Zadanie 1

Program można uruchomić za pomocą polecenia: java Main 6
This commit is contained in:
Cezary Baryłka 2018-07-08 22:21:24 +00:00
parent 16f4649ea6
commit c9e9b68a89
5 changed files with 27 additions and 0 deletions

BIN
zad1/Main.class Normal file

Binary file not shown.

18
zad1/Main.java Normal file
View File

@ -0,0 +1,18 @@
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int n;
if(args.length == 0) {
System.out.println("Proszę podać n ");
Scanner scan = new Scanner(System.in);
n = scan.nextInt();
}
else{
n = Integer.parseInt(args[0]);
}
Ring ring = new Ring(n);
System.out.println(ring.findRingDetails());
}
}

BIN
zad1/NWDCalculator.class Normal file

Binary file not shown.

9
zad1/NWDCalculator.java Normal file
View File

@ -0,0 +1,9 @@
public class NWDCalculator {
public static int findNWD(int a, int b) {
if (b == 0)
return a;
else {
return findNWD(b, a % b);
}
}
}

BIN
zad1/Ring.class Normal file

Binary file not shown.