Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String[] str = new String[4];
- int numPass = str.length();
- Scanner scan_in = new Scanner(System.in);
- for(int x=0; x<numPass; x++;)
- {
- str[x] = scan_in.nextLine();
- }
- for(int pass=1; pass < numPass; pass++)
- {
- for(int i=0; i < numPass-pass; i++)
- {
- if(str[i].compareToIgnoreCase(str[i+1] < 0)
- {
- int temp = str[i]; str[i] = str[i+1]; str[i+1] = temp;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment