From c9e9b68a8974026d705055e152e039b0225f2f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Bary=C5=82ka?= Date: Sun, 8 Jul 2018 22:21:24 +0000 Subject: [PATCH] Zadanie 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Program można uruchomić za pomocą polecenia: java Main 6 --- zad1/Main.class | Bin 0 -> 992 bytes zad1/Main.java | 18 ++++++++++++++++++ zad1/NWDCalculator.class | Bin 0 -> 417 bytes zad1/NWDCalculator.java | 9 +++++++++ zad1/Ring.class | Bin 0 -> 3049 bytes 5 files changed, 27 insertions(+) create mode 100644 zad1/Main.class create mode 100644 zad1/Main.java create mode 100644 zad1/NWDCalculator.class create mode 100644 zad1/NWDCalculator.java create mode 100644 zad1/Ring.class diff --git a/zad1/Main.class b/zad1/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..5d30d9ad69117c3cd9050be2f0e77fe8607de8f1 GIT binary patch literal 992 zcmZuwT~8BH5IwhrZo4ek+`!E^rc6vDZD2<1 zjEQdCl4I7yZOj?SnlLdh#~lL;2JR}v@{a2S%L>u-%!WeOs<&+`^c5Y~e%Y#T+5Q{7 zRU-+|eI(wx-=`wjB75Tg`>+&5EW! z+4i;qrHoy z)|@D@(1(5lix%$TzQVw|?=`<1e@ivIZGHST<)#cgu<#I%=nIvf)@ES|Ibq0Kc#LHO zD;A#MDaD8gaXhoIiZudKP@(^%`Bz&zb|p9il|MHFyUu}oEjotVvv9oZI$H}kEL+#v zSTf`|3o956397NiaQgfaM?}C0X~Au@PDn>PNu)jPkkuHj{V6E8RKy2?TWF6VTp&@q zYWoWDhW49w7<6uVSzfvzY<=$>cUz{jW(V4-ah*fyng0c261{wSsFQW1-9(uFwWEhC0|hIVNzGajB3$lKO*~G(AZ(f@}W(I|I>` literal 0 HcmV?d00001 diff --git a/zad1/Main.java b/zad1/Main.java new file mode 100644 index 0000000..1f4c722 --- /dev/null +++ b/zad1/Main.java @@ -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()); + } +} diff --git a/zad1/NWDCalculator.class b/zad1/NWDCalculator.class new file mode 100644 index 0000000000000000000000000000000000000000..a84d7f99209c35db6d14b8f24bd8588fa2d3280e GIT binary patch literal 417 zcmY*Uy-osQ5S+bVIgcMv(LiMf7SPyfY%nGyhy@1g?~YRs&pUD+K8(*mW2Le10emRq zd_Y4syR$pHJDdIe`~CrNhGP#F4m_ARbkT5eBycX`G%hX$X1g;HSp94o397?5jYf-? zAj&zv}7H{Z(Hj;UZB*mY)mUhd7;*6xi*-pfeDNqH7EU z<#D0H=NmQO$av#yk%!TBygIa{)t#v~<->;K!$+CBTWvv25A+h1KK5>dSrisH;d>U} z1q|>$97dN_k0?a@^b_*2YVR=WHs~cre?0&XyR1t3A{o6rrl>)zwBBJim#t=N{sm)6 k#)MX>5Or?R9GX^ZtT))JveGj(W`aHDCPW{uGc~aP5BbGJ5C8xG literal 0 HcmV?d00001 diff --git a/zad1/NWDCalculator.java b/zad1/NWDCalculator.java new file mode 100644 index 0000000..7a9070c --- /dev/null +++ b/zad1/NWDCalculator.java @@ -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); + } + } +} diff --git a/zad1/Ring.class b/zad1/Ring.class new file mode 100644 index 0000000000000000000000000000000000000000..9ebb65c094ccc44dde8c4d00f002e17719e98360 GIT binary patch literal 3049 zcma)7ZF3V<6n=KI$+qdzmOu)n777+kU!Z_kmGa*35=>j5wUk!WZL)2bZg=BmQ!KtK zTHoItXZ++a&hW(#I-_lc8GeA{2Y-#@I3xPp-IS!HR3@|M-h1x3&pGEg=idBw=jLqy z`|))Y&FHPhLr6v`P6%;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