中国免费域名申请网站,网站建站常见问题,南京网页搜索排名提升,飘雪影视在线观看西瓜2011-12-14 04:21:57 地址#xff1a;http://acm.hdu.edu.cn/showproblem.php?pid2016 题意#xff1a;中文。 mark#xff1a;wa了2次#xff0c;a^b^a^b这种交换只能用在a和b不同的时候#xff0c;否则清零。没考虑第一个元素就是最小值的情况。 代码#xff1a; # in…2011-12-14 04:21:57 地址http://acm.hdu.edu.cn/showproblem.php?pid2016 题意中文。 markwa了2次a^b^a^b这种交换只能用在a和b不同的时候否则清零。没考虑第一个元素就是最小值的情况。 代码 # include stdio.hint a[110] ;int main (){int i, n, pos ;while (~scanf (%d, n) n) {for (i 0 ; i n ;i) scanf (%d, ai) ;for (i 1, pos 0 ; i n ; i)if (a[i]a[pos]) pos i ;if (pos ! 0) a[0] ^ a[pos] ^ a[0] ^ a[pos] ;for (i 0 ; i n ;i ) {if (i 0) printf (%d, a[i]) ;else printf ( %d, a[i]) ; } puts () ; }return 0 ;} 转载于:https://www.cnblogs.com/lzsz1212/archive/2012/01/06/2314509.html