/*
Copyright 2011 Marek "p2004a" Rusinowski
Bubble sort
*/
#include <cstdio>
#define MAXN 1000000
int array[ MAXN] ;
int main( ) {
int n;
scanf ( "%d" , & n) ;
for ( int i = 0 ; i < n; ++ i) {
scanf ( "%d" , & array[ i] ) ;
}
for ( int i = 0 ; i < n; ++ i) {
for ( int j = 0 ; j < ( n - i) - 1 ; ++ j) {
if ( array[ j] > array[ j + 1 ] ) {
int tmp = array[ j] ;
array[ j] = array[ j + 1 ] ;
array[ j + 1 ] = tmp;
}
}
}
for ( int i = 0 ; i < n; ++ i) {
printf ( "%d " , array[ i] ) ;
}
printf ( "\n " ) ;
return 0 ;
}
LyoKICBDb3B5cmlnaHQgMjAxMSBNYXJlayAicDIwMDRhIiBSdXNpbm93c2tpCiAgQnViYmxlIHNvcnQKKi8KI2luY2x1ZGUgPGNzdGRpbz4KCiNkZWZpbmUgTUFYTiAxMDAwMDAwCgppbnQgYXJyYXlbTUFYTl07CgppbnQgbWFpbigpIHsKICBpbnQgbjsKICBzY2FuZigiJWQiLCAmbik7CiAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyArK2kpIHsKICAgIHNjYW5mKCIlZCIsICZhcnJheVtpXSk7CiAgfQogIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgKytpKSB7CiAgICBmb3IgKGludCBqID0gMDsgaiA8IChuIC0gaSkgLSAxOyArK2opIHsKICAgICAgaWYgKGFycmF5W2pdID4gYXJyYXlbaiArIDFdKSB7CiAgICAgICAgaW50IHRtcCA9IGFycmF5W2pdOwogICAgICAgIGFycmF5W2pdID0gYXJyYXlbaiArIDFdOwogICAgICAgIGFycmF5W2ogKyAxXSA9IHRtcDsKICAgICAgfQogICAgfQogIH0KICBmb3IgKGludCBpID0gMDsgaSA8IG47ICsraSkgewogICAgcHJpbnRmKCIlZCAiLCBhcnJheVtpXSk7CiAgfQogIHByaW50ZigiXG4iKTsKICByZXR1cm4gMDsKfQo=
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:13: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
prog.cpp:15: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
stdout