Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function start()
- {
- var zahl= new Array (10);
- var h1 = new Array (10);
- var n, j;
- n=9;
- zahl[0] = 34;
- zahl[1] = 12;
- zahl[2] = 15;
- zahl[3] = 25;
- zahl[4] = 56;
- zahl[5] = 78;
- zahl[6] = 32;
- zahl[7] = 54;
- zahl[8] = 23;
- zahl[9] = 89;
- for (j=n; j>=0; j--)
- {
- max = j;
- for (i=0; i<n+1; i++)
- {
- if (zahl[i] > zahl[max])
- {
- max = i;
- }
- }
- h1[j]=zahl[max];
- zahl [max] = zahl [max] * (-1);
- }
- for (i=0; i< n+1; i++)
- {
- zahl[i]=h1[i]
- }
- for (i=0; i< n+1; i++)
- {
- window.document.write(zahl[i]+"<BR>");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement