0% found this document useful (0 votes)
8 views1 page

Array List

Array List

Uploaded by

Marian Baraulea
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Array List

Array List

Uploaded by

Marian Baraulea
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

package arraylistcuvalfa;

import [Link];
import [Link];
import [Link];

public class ArrayListCuvAlfa {

public static void main(String[] args) {

ArrayList<String> al= new ArrayList<String>();


Scanner sc= new Scanner([Link]);
for(;;)
{
String s= [Link]();

if([Link]("stop"))
break;

[Link](s);
}

int n=[Link](), i , j;
String cuv= new String();
int val=0;
String aux=null;
for(i=0; i<n-1; i ++)
for(j=i+1; j<= n-1; j++){
cuv=[Link](i);
val=[Link]([Link](j));

if(val>0) {
aux=[Link](i);
[Link](i,[Link](j));
[Link](j, aux);
}
}

[Link]("");
for( i=0; i < n ;i++)
[Link]([Link](i));
}

You might also like