|
-
Jun 19th, 2005, 01:42 PM
#1
-
Jun 19th, 2005, 02:51 PM
#2
Banned
Re: fdsafwdg
TeachNoteMeHowToSpeakEnglish
-
Jun 20th, 2005, 09:51 AM
#3
-
Jun 20th, 2005, 12:07 PM
#4
Re: fdsafwdg
bgrehy5hjw5y
-
Jun 21st, 2005, 05:51 AM
#5
Re: fdsafwdg
c++:
Code:
import java.util.*;
class CircleDance
{
public int arrangeDancers(int[] heights)
{
int[] lowestSoFar = heights;
Collections.reverse(Arrays.asList(heights));
if (heights.length == 3)
{
return heights[heights.length-1] - heights[0];
}
int maxDifference = heights[heights.length-1]-heights[0];
int temp;
int temp2;
for (int back=heights.length-1; back>=0; back--)
{
for(int front=0; front<heights.length; front++)
{
if (front == heights.length-1)
{
if (heights[front] > heights[0])
{
temp = heights[front];
temp2 = heights[0];
heights[front] = temp2;
heights[0] = temp;
}
}
else if (front < heights.length-1)
{
if (heights[front] > heights[front+1])
{
temp = heights[front];
temp2 = heights[front+1];
heights[front] = temp2;
heights[front+1] = temp;
for (int i=0; i<heights.length; i++)
{
if (i == heights.length-1)
{
if ((heights[i]+heights[0]) < maxDifference)
{
maxDifference = heights[i] + heights[0];
}
}
else if (i < heights.length-1)
{
if ((heights[i] + heights[i+1]) < maxDifference)
{
maxDifference = heights[i] + heights[i+1];
}
}
}
if ((heights[0] + heights[heights.length-1]) < maxDifference)
{
maxDifference = heights[0] + heights[heights.length-1];
}
}
}
}
}
return maxDifference;
}
public static void main(String[] args)
{
int[] d = {170,180,190};
CircleDance cd = new CircleDance();
System.out.println(cd.arrangeDancers(d));
}
}
-
Jun 21st, 2005, 05:51 AM
#6
Re: fdsafwdg
java:
Code:
import java.util.*;
class CircleDance
{
public int arrangeDancers(int[] heights)
{
int[] lowestSoFar = heights;
Collections.reverse(Arrays.asList(heights));
if (heights.length == 3)
{
return heights[heights.length-1] - heights[0];
}
int maxDifference = heights[heights.length-1]-heights[0];
int temp;
int temp2;
for (int back=heights.length-1; back>=0; back--)
{
for(int front=0; front<heights.length; front++)
{
if (front == heights.length-1)
{
if (heights[front] > heights[0])
{
temp = heights[front];
temp2 = heights[0];
heights[front] = temp2;
heights[0] = temp;
}
}
else if (front < heights.length-1)
{
if (heights[front] > heights[front+1])
{
temp = heights[front];
temp2 = heights[front+1];
heights[front] = temp2;
heights[front+1] = temp;
for (int i=0; i<heights.length; i++)
{
if (i == heights.length-1)
{
if ((heights[i]+heights[0]) < maxDifference)
{
maxDifference = heights[i] + heights[0];
}
}
else if (i < heights.length-1)
{
if ((heights[i] + heights[i+1]) < maxDifference)
{
maxDifference = heights[i] + heights[i+1];
}
}
}
if ((heights[0] + heights[heights.length-1]) < maxDifference)
{
maxDifference = heights[0] + heights[heights.length-1];
}
}
}
}
}
return maxDifference;
}
public static void main(String[] args)
{
int[] d = {170,180,190};
CircleDance cd = new CircleDance();
System.out.println(cd.arrangeDancers(d));
}
}
-
Jun 21st, 2005, 05:53 AM
#7
Re: fdsafwdg
mytest, he said with a hope in his voice:
import java .util .*;
class CircleDance
{
public int arrangeDancers (int[] heights )
{
int[] lowestSoFar = heights ;
Collections .reverse (Arrays .asList (heights ));
if (heights .length == 3)
{
return heights [heights .length -1] - heights [0];
}
int maxDifference = heights [heights .length -1]-heights [0];
int temp ;
int temp2 ;
for (int back =heights .length -1; back >=0; back --)
{
for(int front =0; front <heights .length ; front ++)
{
if (front == heights .length -1)
{
if (heights [front ] > heights [0])
{
temp = heights [front ];
temp2 = heights [0];
heights [front ] = temp2 ;
heights [0] = temp ;
}
}
else if (front < heights .length -1)
{
if (heights [front ] > heights [front +1])
{
temp = heights [front ];
temp2 = heights [front +1];
heights [front ] = temp2 ;
heights [front +1] = temp ;
for (int i =0; i <heights .length ; i ++)
{
if (i == heights .length -1)
{
if ((heights [i ]+heights [0]) < maxDifference )
{
maxDifference = heights [i ] + heights [0];
}
}
else if (i < heights .length -1)
{
if ((heights [i ] + heights [i +1]) < maxDifference )
{
maxDifference = heights [i ] + heights [i +1];
}
}
}
if ((heights [0] + heights [heights .length -1]) < maxDifference )
{
maxDifference = heights [0] + heights [heights .length -1];
}
}
}
}
}
return maxDifference ;
}
public static void main(String [] args )
{
int[] d = {170,180,190};
CircleDance cd = new CircleDance ();
System .out .println (cd .arrangeDancers (d ));
}
}
-
Jun 21st, 2005, 11:26 PM
#8
Fanatic Member
Re: fdsafwdg
Code:
import java.util.*;
class CircleDance
{
public int arrangeDancers(int[] heights)
{
int[] lowestSoFar = heights;
Collections.reverse(Arrays.asList(heights));
if (heights.length == 3)
{
return heights[heights.length-1] - heights[0];
}
int maxDifference = heights[heights.length-1]-heights[0];
int temp;
int temp2;
for (int back=heights.length-1; back>=0; back--)
{
for(int front=0; front<heights.length; front++)
{
if (front == heights.length-1)
{
if (heights[front] > heights[0])
{
temp = heights[front];
temp2 = heights[0];
heights[front] = temp2;
heights[0] = temp;
}
}
else if (front < heights.length-1)
{
if (heights[front] > heights[front+1])
{
temp = heights[front];
temp2 = heights[front+1];
heights[front] = temp2;
heights[front+1] = temp;
for (int i=0; i<heights.length; i++)
{
if (i == heights.length-1)
{
if ((heights[i]+heights[0]) < maxDifference)
{
maxDifference = heights[i] + heights[0];
}
}
else if (i < heights.length-1)
{
if ((heights[i] + heights[i+1]) < maxDifference)
{
maxDifference = heights[i] + heights[i+1];
}
}
}
if ((heights[0] + heights[heights.length-1]) < maxDifference)
{
maxDifference = heights[0] + heights[heights.length-1];
}
}
}
}
}
return maxDifference;
}
public static void main(String[] args)
{
int[] d = {170,180,190};
CircleDance cd = new CircleDance();
System.out.println(cd.arrangeDancers(d));
}
}
Here is java now. Or do you want me to base the color from Cander's original?
-
Jun 22nd, 2005, 01:17 AM
#9
Re: fdsafwdg
You could copy the PHP higghlighting 
PHP Code:
$var = 1;
$string = 'string';
$string1 = "string\r\n";
/* comment */
// comment
function name ($param1, $param2) {
if ($param1 == 1) {
echo('name');
}
return;
}
-
Jun 22nd, 2005, 01:22 AM
#10
Fanatic Member
Re: fdsafwdg
Ok, I'll try. Just can't promise much. But I'll try.
-
Jun 22nd, 2005, 01:26 AM
#11
Re: fdsafwdg
You are very smart - I have faith in your abilities
-
Jun 22nd, 2005, 01:29 AM
#12
Fanatic Member
Re: fdsafwdg
Haha. That's funny. I've never heard one of those since 10.
Edit: We'll also be expecting your Delphi syntax highlighter.
-
Jun 22nd, 2005, 02:02 AM
#13
Re: fdsafwdg
Get to work - *whip*whip*
-
Jun 22nd, 2005, 02:12 AM
#14
Last edited by NoteMe; Jun 22nd, 2005 at 02:32 AM.
-
Jun 22nd, 2005, 02:34 AM
#15
Re: fdsafwdg
Indent test in quote tag:
function name ($param1, $param2) {
if ($param1 == 1) { } }
-
Jun 23rd, 2005, 02:49 AM
#16
Re: fdsafwdg
normal
test 1test 1
test 2test 2
test 3test 3
test 4test 4
test 5test 5
test 6test 6
test 7test 7
-
Jun 23rd, 2005, 02:52 AM
#17
-
Jun 23rd, 2005, 02:57 AM
#18
Re: fdsafwdg
123456789123456789
123456789,,,,,,,,,
123456789123,,,,,,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|