标签:style blog io color sp for on div log
#include<stdio.h> int main () { #ifdef ONLINE_JUDGE #else freopen ("in.txt","r",stdin); #endif int n,m; int a[101]; while(scanf("%d",&n)!=EOF&&(n<100&&n!=0)) { for (int i=0;i<n;++i) scanf("%d",&a[i]); for (int i=0;i<n;++i) for (int k=0;k<n-i;++k) if(a[k]>a[k+1]) { m=a[k]; a[k]=a[k+1]; a[k+1]=m; } for (int i=0;i<n;++i) printf("%d ",a[i]); printf("\n"); } return 0; }
标签:style blog io color sp for on div log
原文地址:http://www.cnblogs.com/lonelysky/p/4117514.html