Zadanie 1 i 2 #38

Open
s416042 wants to merge 6 commits from s416042/DALGLI0:master into master
5 changed files with 27 additions and 0 deletions
Showing only changes of commit c9e9b68a89 - Show all commits

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.