I'm trying to understand what you mean. As an example...
Say you have a list of numbers.
First quarter: 89, 7
Second quarter: 6, 5
Thrid quarter: 4, 3
Fourth quarter: 3, 1
Is this what you mean? In order for the
list to be split into quarters the
total number of elements in the list
has to be a exactly divisible by 4.
Let's say I had nine instead of eight
elements- using the first example again.
First quarter: 89, 12
Left over(s): 1
What you intend to do with the left overs
is up to you. But clearly, you cannot divide
a list of nine elements evenly into four.
I have written a code for you which does as you ask, if indeed I
have interpreted what you mean correctly. It should be easy to
understand and you may want to use a function to call each quarter.
using namespace std;
// store numbers inside an array
cout<<"Enter number or 0 to quit:";
// Find out what each quarter of the total list is
// Note it has to be 'int' rather than 'float'
int quarter_2= 2*quarter;
int quarter_3= 3*quarter;
int quarter_4= 4*quarter;
int left_over= (count-1)-quarter_4; // if the list is not divisible by 4
//Begin to order list of numbers in descending order
//Use method similar to bubble sort
for (int a=0; a<count-1; a++)
for (int b=0; b<count-1; b++)
// You can put this into a function if you want
for (int m=0; m<quarter; m++)
for (int n=quarter; n<quarter_2; n++)
for (int o=quarter_2; o<quarter_3; o++)
for (int p=quarter_3; p<quarter_4; p++)
for (int q=quarter_4; q<(quarter_4)+left_over; q++)