Skip to content
Snippets Groups Projects
Commit e27ea5c9 authored by Adam Blank's avatar Adam Blank
Browse files

Adds more input files

parent 8a8e4bb6
No related branches found
No related tags found
No related merge requests found
To test your code on other inputs, replace the P.input file with another file. We have provided
three examples for you which we will use to test your code.
public static void P(String input) {
System.out.print(input.hashCode());
}
public static void P(String input) {
System.out.print(input);
}
public static void P(String input) {
/* Stupid Bubble Sort! */
char[] array = input.toCharArray();
boolean swapped = true;
int j = 0;
char tmp;
while (swapped) {
swapped = false;
j++;
for (int i = 0; i < array.length - j; i++) {
if (array[i] > array[i + 1]) {
tmp = array[i];
array[i] = array[i + 1];
array[i + 1] = tmp;
swapped = true;
}
}
}
System.out.println(new String(array));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment