C++ comp. (10, permasaged)

1 Name: age : 2006-07-17 15:10 ID:ZqKX3p92 This thread was merged from the former /code/ board. You can view the archive here.

we have a compitition...

first person to write a C++ program that does the following:
Calculate PI to 100 decimal places
Output the result
In under a sec

will get a nice hosting prize from HydroHost

2 Name: #!/usr/bin/anonymous : 2006-07-17 17:10 ID:suHk7oeV

>>1 you should be a little better at posting your thread.

Make your topic a lot more informative. You could have used something like "[Competition] C++ and Pi" that tells us a bit more. Abbreviations suck. You should use some correct spelling and grammar. You don't have to be a grammar nazi, the occaisional mistake is okay.

"age" doesn't do anything. A blank "link" field is the same as an "age". "sage" wouldn't do anything either, since new threads automatically bump to the top.

Just because 4-ch is open to everyone and registration free doesn't mean you can make excuses for being a lazy idiot. http://4-ch.net/wiki/guide_to_posting

Also: The speed of which a program calculates is highly restricted on the CPU.

3 Name: #!/usr/bin/anonymous : 2006-07-18 02:47 ID:Heaven

`#include <iostream>
#include <string>
using namespace std;
string notpi = "8)6960471080342487839171988387240573396426148448206503754294990478523619517317534431735893708976625124";

char calculate(char input) {

if(input < '5') return (input + 5);
return (input - 5);

}

int main() {

for(string::iterator i=notpi.begin();i<notpi.end();++i)
*i = calculate(*i);
cout << notpi << endl;
return 0;

}`

4 Name: #!/usr/bin/anonymous : 2006-07-18 06:17 ID:Heaven

>>3
lol

5 Name: #!/usr/bin/anonymous : 2006-07-18 12:33 ID:CtdUa77F

>>3
should've used std::for_each

6 Name: #!/usr/bin/anonymous : 2006-07-20 15:09 ID:iM3kw4XI

Yeah, the solve my homework thread is that way -------->

7 Name: age : 2006-07-25 01:36 ID:1T2ddQU4

not sage kudasai

8 Name: age : 2006-07-25 01:37 ID:1T2ddQU4

age

9 Name: #!/usr/bin/anonymous : 2015-12-01 10:44 ID:Heaven

test

10 Name: Anonymous Techie : 2023-10-02 09:09 ID:c8ZYV8kZ

         _,met$$$$$gg.
,g$$$$$$$$$$$$$$$P.
,g$$P" """Y$$.".
,$$P' `$$$.
',$$P ,ggs. `$$b:
`d$$' ,$P"' . $$$
$$P d$' , $$P
$$: $$. - ,d$$'
$$; Y$b._ _,d$P'
Y$$. `.`"Y$$$$P"'
`$$b "-.__
`Y$$
`Y$$.
`$$b.
`Y$$b.
`"Y$b._
`"""
Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: