Bubbles ~~~

Source: Internet
Author: User

 // Bubbles ~~~ <Br/> public class T5 {<br/> Public static void main (string [] ARGs) {<br/> try {<br/> // int max = 10; <br/> int [] a1 = {,}; <br/> for (INT I2 = 0; i2 <a1.length; I2 ++) <br/> for (INT I = 1; I <a1.length; I ++) {<br/> If (A1 [I-1]> A1 [I]) {<br/> // when the current number is greater than the last number <br/> int tmpa1 = A1 [I-1]; <br/> // make the temporary number equal to the previous number <br/> A1 [I-1] = A1 [I]; <br/> // set the previous number to the next number <br/> A1 [I] = tmpa1; <br/> // set the last number The number is equal to the temporary number <br/> // drag the large number to the next step ~~ <Br/>}< br/> for (INT I1 = 0; I1 <a1.length; I1 ++) {<br/> system. out. print (A1 [I1] + ""); <br/>}< br/>/* For (INT I2: A1) {<br/> // system. out. print (A1 [I2] + ""); <br/> system. out. print (I2 + ""); <br/>} */<br/>} catch (arrayindexoutofboundsexception e) {<br/> system. err. println (E); <br/>}< br/>}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.