By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,915 Members | 1,268 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,915 IT Pros & Developers. It's quick & easy.

Race problem

P: 2
"race
N cars are lined up at the starting line of a Formula 1 race.
Task
Write a program that determines in how many ways the cars can pass the finish line, knowing that there may be more than one car arriving at the same time.
Input Data
Input file race.in contains a single line which has positive integer N on it.
Output Data
Output file race.out will contain a single line with the number of ways the cars can pass the finish line.
Restrictions
1 <= N <= 100
Examples
race.in race.out Explanation
2 3 1st way: the two cars pass the finish line in order 1, 2
2nd way: the two cars pass the finish line in order 2, 1
3rd way: the cars pass the finish line at the same time."
The algoritm i believe can be resolved mathematically, although the formula I haven't discovered yet. If you can help send the answer at: puscas_marinar@yahoo.com
Jan 2 '07 #1
Share this Question
Share on Google+
2 Replies


P: 2
And btw I forgot to tell that the problem is in C++.
Jan 2 '07 #2

P: 7
already sent you an e-mail..
hope it helps...
Jan 3 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.