2 Replies - 3710 Views - Last Post: 02 October 2008 - 05:31 PM Rate Topic: -----

#1 teff  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 02-October 08

Sorting a set of numbers without using array and functions

Post icon  Posted 02 October 2008 - 09:42 AM

Hello everybody.
I'm a C++ programming beginner.

I would like to ask how to sort a set of numbers without using array and any functions.

Thanks. :)
Is This A Good Question/Topic? 0
  • +

Replies To: Sorting a set of numbers without using array and functions

#2 ajwsurfer  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 373
  • Joined: 24-October 06

Re: Sorting a set of numbers without using array and functions

Posted 02 October 2008 - 11:45 AM

Include all the sort code in the "main()" function. Form policy is to only offer help to people who post actual code. Good Luck.

This post has been edited by ajwsurfer: 02 October 2008 - 11:46 AM

Was This Post Helpful? 0
  • +
  • -

#3 teff  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 02-October 08

Re: Sorting a set of numbers without using array and functions

Posted 02 October 2008 - 05:31 PM

OK.

The situation is that I need to sort the following group of time of different players of the 100 metre dash competition within three groups.
Each group with gold, silver and bronze medal.

1 Usain,Bolt 9.69
1 Richard,Thompson 9.89
1 Walter,Dix 9.91
1 Churandy,Martina 9.93
1 Asafa,Powell 9.95
1 Michael,Frater 9.97
1 Marc,Burns 10.01
1 Darvis,Patton 10.03
2 Shelly-Ann,Fraser 10.78
2 Sherone,Simpson 10.97
2 Kerron,Stewart 10.98
2 Lauryn,Williams 11.03
2 Muna,Lee 11.07
2 Jeanette,Kwakye 11.14
2 Debbie,Ferguson-Mckenzie 11.19
2 Torri,Edwards 11.20
3 Xuxiang,Lin 13.93
3 Unidentified,Runner 18.66
3 Pedro,Sander 14.00
3 Chang,Xu 15.65
3 Kevin,Schmidt 14.03


My code so far:
#include <iostream> // enable the usage of cin/cout
#include <string> // enable the usage of string
using namespace std;

int main() 
{
	string man1, man2, man3;
	string woman1, woman2, woman3;
	string comp1, comp2, comp3;
	
	string name;
	int group;
	double result;
	
	double 
	
	cin>>group>>name>>result;
	
	while ( !cin.eof() )  
	{
		  while (group == 1 || group == 2 || group == 3)
		  {if (group == 1)
			  { 
			 
	}

	
	return 0;
} 


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1