Created
February 17, 2017 20:37
-
-
Save dubrovskyi/af0c5b38deded2a9926ac04e6e3a9cbb to your computer and use it in GitHub Desktop.
hello
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Package1; | |
import java.lang.reflect.Array; | |
import java.util.Arrays; | |
public class NewClass1 { | |
public static void main(String[] args) { | |
int[] arr = {1, 9, 3, 8, 5, 6, 7}; | |
/* | |
int temp; | |
System.out.println(Arrays.toString(arr)); | |
for (int i = 0; i < arr.length / 2; i++) { | |
temp = arr[arr.length - 1 - i]; | |
arr[arr.length - 1 - i] = arr[i]; | |
arr[i] = temp; | |
if(temp%3==1) | |
continue;{ | |
System.out.println("works");} | |
} | |
System.out.println(Arrays.toString(arr)); | |
int temp1; | |
for (int bar = arr.length - 1; bar >= 0; bar--) { | |
for (int i = 0; i < arr.length-1; i++) { | |
if (arr[i] > arr[i + 1]) { | |
temp1 = arr[i + 1]; | |
arr[i + 1] = arr[i]; | |
arr[i] = temp1; | |
} | |
} | |
} | |
System.out.println(Arrays.toString(arr)); | |
*/ | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Package1; | |
import java.util.Arrays; | |
public class NewClass2 { | |
public static void main(String[] args) { | |
for (int i = 0; i < args.length / 2; i++) { | |
String term = args[i]; | |
args[i] = args[args.length - 1 - i]; | |
args[args.length - 1 - i] = term; | |
} | |
System.out.println(Arrays.toString(args)); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Package1; | |
import java.util.Arrays; | |
public class NewClass3 { | |
public static void main(String[] args) { | |
String pass = "hi"; | |
System.out.println(args[0].equals(pass)); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Package1; | |
public class NewClass4 { | |
public static void main(String[] args) { | |
int x = 12345123; | |
if (args.equals(x)) { | |
System.out.println("the same password"); | |
} else { | |
System.out.println("passwords are different"); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Package1; | |
public class NewClass5 { | |
public static void main(String[] args) { | |
int p = 0; | |
int p1 = 1; | |
for (String k : args) { | |
p += Integer.parseInt(k); | |
p1 *= Integer.parseInt(k); | |
} | |
System.out.println(p); | |
System.out.println(p1); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Package1; | |
public class NewClass61 { | |
public static void main(String[] args) { | |
int t = Integer.parseInt(args[0]); | |
for (int i = 0; i < args.length; i++) { | |
if (Integer.parseInt(args[i]) > t) t = Integer.parseInt(args[i]); | |
} | |
System.out.println(t); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Package1; | |
public class NewClass61_ { | |
public static void main(String[] args) { | |
int t = Integer.parseInt(args[0]); | |
for (int i = 0; i < args.length; i++) { | |
int t1 = Integer.parseInt(args[i]); | |
if (t1 < t) t = Integer.parseInt(args[i]); | |
} | |
System.out.println(t); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment