|
|
no loop, and no goto as requirements are something that would only make sense in the context of a cheater trying to avoid doing his schoolwork. Such posts should be answered with a LARTing, not a proper solution.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
I believe Michael was handling the situation admirably.
And I guess he knew what he was posting...
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
shouldnt that be
printf("1 to 10");
?
Luc Pattyn
|
|
|
|
|
public void PrintUpToNumber(int StartNumber, int EndNumber)<br />
{<br />
Console.WriteLine(StartNumber);<br />
if(StartNumber < EndNumber) PrintUpToNumber(StartNumber+1,EndNumber);<br />
}
Something like that?
Russ
|
|
|
|
|
$intelligent-linux: Hey!
Yes dear user?
$intelligent-linux: Someone on codeproject forums came up with this weird problem
Tell me about it....
$intelligent-linux: Well, the guy wanted some numbers printed without using loops and stuff
So? what's the big deal?
$intelligent-linux: I think he was on Windows
There you go........So what happened finally?
$intelligent-linux: Nothing, I was just wondering if it can be done without loops and stuff
Watch this........1 2 3 4 5 6 7 8 9 10
$intelligent-linux: Oh my god, those were the numbers he mentioned there!!! How did you know?
Welcome to the linux shell dearie, this is where God speaks.
:->
ASP - AJAX is SEXY. PERIOD.
|
|
|
|
|
That's not the minimum number of if-conditions, you can do it with 0 (at least in C++):
template<int n>
void printUntil10() {
cout << n << endl;
printUntil10<n+1>();
}
template<>
void printUntil10<10>() {
cout << 10 << endl;
}
int main() {
printUntil10<1>();
return 0;
}
|
|
|
|
|
while (ain't between 1 and 10)
don't
{
print number y'all;
}
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
Hi,
I was looking at the "Solver Platform SDK" from Frontline Systems, Inc (
http://www.solver.com/technology2.htm#Primal%20and%20Dual%20Simplex%20Method)
as a way to do some optimization problems in an application, but their licensing seems rather complicated and expensive. Does anybody know of a cheaper alternative product and/or can somebody suggest a good introduction to the primal and dual simplex method so that I might look into rolling my own?
Thanks.
|
|
|
|
|
I'm not sure if it's what you're after but perhaps uBLAS[^] (or BLAS) can help.
Steve
|
|
|
|
|
Hi Wjousts,
most likely TOMNET (the TOMNET Optimization Platform for .NET: http://tomopt.com/tomnet/ ) is something for you.
TOMNET solves linear, quadratic and linear least squares problems (and more), so you'll go well armed in the world of optimization .
Sample code, mathematical formulation and syntax for a linear programming (optimization) problem is found here: http://tomopt.com/docs/tomnet_quickguide/tomnet_quickguide003.php
TOMNET also comes as a free 21 day demo so you can try it at no cost.
HTH,
/Per
--
Per Strandberg
.NET Architect - Optimization
Tomlab Optimization Inc.
http://tomopt.com/tomnet/
|
|
|
|
|
Hi!
I have follwing sequence of integers ...
1,3,4,5,9,12,13,14,15,17,19,20,21,22,23,24,30
i want to group above integers as
1,3-5,9,12-15,17,19-24,30
can any one suggest an algo.?
Thanks & Regards,
SAMir Nigam,
Software Developer,
STPL, Lucknow, India.
|
|
|
|
|
Just check if the next number minus current equals 1 and append -. Then replace ---- with -. However, I always liked seeing 1, 3, 4, 6 as that and not 1, 3-4, 6.
|
|
|
|
|
Hi all.
I write class to handel the big integer number problem, but my division algorithm is to weak. if I wont to divid 'a' into 'b' I must get the bite code of 'a','b' and divide this numebr by using this bite code. it take tol of time and this algoritm works on integer number only.I wont to solwe this two problem.
Can some one help me and give better algorithm or tel where I can find it.
Thanks for any help.
|
|
|
|
|
Doing division efficiently is not very straightforward; there are many algorithms.
You could have a look at:
- some "big integer" articles on CodeProject
- the GNU multi-precision library [^]
- hundreds of books, e.g. The Art of Computer Programming, Volume 2, Seminumerical
Algorithms, by Donald Knuth.
- Google
I myself would be interested in a .NET wrapper for the GNU library, because I work in
.NET and the GNU library is very extensive.
Regards
Luc Pattyn
|
|
|
|
|
Luc Pattyn wrote: I myself would be interested in a .NET wrapper for the GNU library, because I work in
.NET and the GNU library is very extensive.
Is the library released under the GPL, or LGPL?
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
I dont know, but I did include the link...
Luc Pattyn
|
|
|
|
|
Look into MIRACL.
"It is the mark of an educated mind to be able to entertain a thought without accepting it." - Aristotle
Web - Blog - RSS - Math - LinkedIn - BM
|
|
|
|
|
Class Diagram::LongMath<br />
Addition <br />
Add(sourceA As String, sourceB As String) As String<br />
Subtraction <br />
Subtract(sourceA As String, sourceB As String) As String<br />
Multiplication <br />
Multiply(sourceA As String, sourceB As String) As String<br />
Division<br />
Divide(divisor As String, dividend As String) As String
source[^]
I'm listening but I only speak GEEK.
|
|
|
|
|
Hi AreJay,
I was aware of this package, but I didnt mention it since I am not convinced
string representations will lead to good performance.
Most "big integer" packages use arrays of ints or something similar, which
is more computer-friendly.
Regards,
Luc Pattyn
|
|
|
|
|
Luc Pattyn,
Thanks for the information. When I wrote the class using a string was the only way it made since to me but now I'll convert it to an int array instead of a char array. I've been working on my C# and hope to re-write my Long Math class with C# so any performance tips would be greatly appreciated. Thanks again for the helpful advice.
I'm listening but I only speak GEEK.
|
|
|
|
|
thanks all , it help me lot.
Now I have new idea's.
I have class thet works with "big integer" and with "finite field", I wish thet it works for float to and it wos faster.
if I made good class thet works with "big integer and folat", I will publish it.
|
|
|
|
|
Hi,
I want to know, how I can get matrix of positions of pixels of image in the coordinate system (x,y) in matlab?
thank you
soso
|
|
|
|
|
Can anyone suggest some online resources from which to learn discrete math and computer applications. Using C++, as my choice and writing code to classify functions, input relations from sets and test functions,
|
|
|
|
|
I found this site[^] rather interesting...
"...a photo album is like Life, but flat and stuck to pages." - Shog9
|
|
|
|