diff --git a/fakrekursif.class b/fakrekursif.class new file mode 100644 index 0000000..4df7ae2 Binary files /dev/null and b/fakrekursif.class differ diff --git a/fakrekursif.java b/fakrekursif.java new file mode 100644 index 0000000..770f060 --- /dev/null +++ b/fakrekursif.java @@ -0,0 +1,16 @@ +public class fakrekursif{ + + public static int faktorial(int n){ + if(n==1) + return 1; + else + return (n * faktorial(n-1)); + + } + + public static void main(String[] args) + { + int value = Integer.parseInt(args[0]); + System.out.println(faktorial(value)); + } +} \ No newline at end of file diff --git a/faktorial.class b/faktorial.class new file mode 100644 index 0000000..ff199c8 Binary files /dev/null and b/faktorial.class differ diff --git a/faktorial.java b/faktorial.java new file mode 100644 index 0000000..ba68493 --- /dev/null +++ b/faktorial.java @@ -0,0 +1,14 @@ +public class faktorial +{ + public static void main(String[] args) + { + int value = Integer.parseInt(args[0]); + int i =1; + int res=1; + for(i=1;i<=value;i++) + { + res *= i; + } + System.out.println(res); + } +} \ No newline at end of file diff --git a/hw.class b/hw.class new file mode 100644 index 0000000..97c3de9 Binary files /dev/null and b/hw.class differ diff --git a/hw.java b/hw.java new file mode 100644 index 0000000..95c7fce --- /dev/null +++ b/hw.java @@ -0,0 +1,35 @@ +//Abdi Elman D. A. +//import java.util.*; + +public class hw{ + public static void main(String[] args){ + //Scanner scaner = new Scanner(System.in); + if(args.length != 1){ + System.out.println("----"); + } + //int score = scaner.nextInt(); + int score = Integer.parseInt(args[0]); + String grade; + if(score<=20) + { + grade = "E"; + } + else if(score > 20 && score <= 40) + { + grade = "D"; + } + else if(score >40 && score <= 60) + { + grade = "C"; + } + else if(score >60 && score <=80) + { + grade = "B"; + } + else{ + grade = "A"; + } + + System.out.println(grade); + } +} \ No newline at end of file diff --git a/sort.class b/sort.class new file mode 100644 index 0000000..7e0d1ac Binary files /dev/null and b/sort.class differ diff --git a/sort.java b/sort.java new file mode 100644 index 0000000..ebe960b --- /dev/null +++ b/sort.java @@ -0,0 +1,29 @@ +public class sort{ + public static void main(String[] args) + { + int len = args.length; + int[] arr; + arr = new int[len]; + for(int i=0; i arr[j]){ + temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; + } + } + } + + for(int i=0; i