Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Java loop array

		Scanner scanner = new Scanner( System.in );
        int n = scanner.nextInt();
        int[] a=new int[ n + 1 ];
        for( int k = 1; k <= n; k ++ ){
            a[ k ] = scanner.nextInt();
        }
        Arrays.sort( a );
        for( int k = 1; k <= n; k ++ ){
            System.out.print( a[k] + " " );
        }
Source by codeforces.com #
 
PREVIOUS NEXT
Tagged: #Java #loop #array
ADD COMMENT
Topic
Name
9+2 =