No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
6 Posted Topics
Re: [QUOTE=Rashakil Fol]Maybe something simpler... [CODE]long fib_num(long n) { long low(0), high(1); while (n--) { high += low; low = high - low; } return low; }[/CODE][/QUOTE] Wouldn't that trap high at 1 and low at 0? Perhaps 1, 1 are what you meant as starting vars. | |
Re: To see it simpler this way in terms of schematics, here we are: There are two phases in your program. The test-taking phase, and the test-grading phase. Both can be done in a loop, as you have 20 questions to ask, and then 20 to grade, both of which can … | |
Re: No fancy stuff needed... your for statement is just screwed up for second half. for (lineCount = number; lineCount >= 0; lineCount --) { for (asteriskCount = lineCount; asteriskCount >= 0; asteriskCount --) System.out.print("*"); } System.out.println(); } //end else You have to start at the condition you used going up … | |
Any clean way to get from one to the other? erase() has been pretty vexing for me. | |
Now, in this particular one, I'm attempting to make a two-dimensional container that stores vectors. Of course, I wanted both dimensions to be dynamic at first, but once convinced that even attempting to do a 2D vector was nearly impossible or required a heap of used memory via the resize() … | |
Re: Use modulus (this operator gets the remainder of a / b) 16 repeatedly to get your digits. Use a while loop while dividing the given number by 16 after modulus (use ints, you want truncation) until the given number becomes less than 16. ie. You have a number, say 254. … |
The End.