Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 30th, 2005, 2:30 AM   #11
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 6 bl00dninja is on a distinguished road
there is no need whatsoever to repost the entire code of the OP as a quote to comment on it. it's all there in the thread. quit overworking my mouse wheel.

:p
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.
bl00dninja is offline   Reply With Quote
Old Dec 7th, 2005, 12:11 AM   #12
kludge
Newbie
 
Join Date: Aug 2005
Posts: 2
Rep Power: 0 kludge is an unknown quantity at this point
It looks like the loop in int yeah(int y) is just calculating an arithmetic series from 0 to y. The loop can be removed and replaced with the formula for this sum which is: tv = y*(y+1)/2
kludge is offline   Reply With Quote
Old Dec 13th, 2005, 8:47 PM   #13
2roll4life7
Programmer
 
2roll4life7's Avatar
 
Join Date: Aug 2005
Location: 0x0010 * 0x0091 + 0x0004
Posts: 65
Rep Power: 4 2roll4life7 is on a distinguished road
Quote:
Originally Posted by bl00dninja
there is no need whatsoever to repost the entire code of the OP as a quote to comment on it. it's all there in the thread. quit overworking my mouse wheel.

:p
If you hold your mouse over to the side of the quote box, it should scroll the page instead of the quote box.
__________________
#if 0 /* in case someone actually tries to compile this */
- libpng version 1.2.8 (example.c)

<Jim_McNeat> Is there like a way to put a compiler in "Just trust me on that one" mode?
2roll4life7 is offline   Reply With Quote
Old Dec 13th, 2005, 9:20 PM   #14
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Quote:
Originally Posted by bl00dninja
quit overworking my mouse wheel.
Squeak.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Feb 12th, 2006, 10:43 PM   #15
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 648
Rep Power: 4 Jessehk is on a distinguished road
Quote:
Originally Posted by ersken
Recursion is beautiful.
	public static int sum(int n) { 
		return (n > 0) ? n + sum(n-1) : 0;   
	}

Or just use my little formula :p

sum = 1/2x^2 + 1/2x

eg: 10
1/2 * 100 + 5
50 + 5
55
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!

Last edited by Jessehk; Feb 12th, 2006 at 10:56 PM.
Jessehk is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:30 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC