# Thread: How to find biggest two int. numbers from four

1. Member
Join Date
May 2014
Posts
3
Rep Power
0

## How to find biggest two int. numbers from four

Hello... this is my first thread I'm posting, so sorry if I may make some mistakes.

So, if you are a football/soccer fan, you know that in every FIFA World Cup you have 4 nations. From those 4, 2 will qualify to the Knockout stages.

Let's say, after all the group fixtures are played, the standings are as follows :
1. England - 6 points
2. Spain - 4 points
3. Brasil - 3 points
4. Germany - 1 point

I want to know how I can select ONLY England and Spain for the Knockout stage of the FIFA World Cup (The class I am working on).

Thank you very much for your help.
- Keimic53

2. ## Re: How to find biggest two int. numbers from four

What have you tried?

3. Member
Join Date
May 2014
Posts
3
Rep Power
0

## Re: How to find biggest two int. numbers from four

Hello Norm, thank you for your time.

Let's say each group's variables are:
int t1, t2, t3, t4;
^ (For each team) ^

I tried this 'Math.max' thing, which I'm still new to, to get an idea of how inexperienced I am so far.

Example:
int first = Math.max(t1, t2);
int second = Math.max(t3, t4);

But that doesn't make total sense, because if:
(t1 = 5), (t2 = 4) , (t3 = 2), (t4 = 1)... than the qualified teams are 1 and 3, not 1 and 2, as it's supposed to be.

Thank you again for your time
- Keimic53

4. Member
Join Date
May 2014
Posts
3
Rep Power
0

## Re: How to find biggest two int. numbers from four

By the way, the points and fixtures are chosen randomly (Math.random)... although that is done.
Sorry for not advising you earlier.

Keep in mind also that two or more of the four teams may end up with the same points...
Thanks.

5. ## Re: How to find biggest two int. numbers from four

two or more of the four teams may end up with the same points...
What is reported if that happens?
4 with same points
3 with same high points
2 with same high points
2 with same high and 2 with same second high points
2 with same second high points
etc

6. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
6,155
Rep Power
12

## Re: How to find biggest two int. numbers from four

Originally Posted by keimic53
Example:
int first = Math.max(t1, t2);
int second = Math.max(t3, t4);
There is nothing that says you can't feed the result of one max comparison, into another one.

Regards,
Jim

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•