Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Nov 8th, 2005, 7:02 AM   #1
sinix
Programmer
 
sinix's Avatar
 
Join Date: Nov 2005
Location: China
Posts: 47
Rep Power: 0 sinix is on a distinguished road
Send a message via MSN to sinix
Talking An Amazing Program,come and have a look : )

Can you figure out what this program is doing?

#include <stdlib.h>
#include <stdio.h>

long a=10000,b,c=2800,d,e,f[2801],g;

main()
{
for(;b-c;)
f[b++]=a/5;
for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)
for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b);
}
sinix is offline   Reply With Quote
Old Nov 8th, 2005, 7:09 AM   #2
bivhitscar
Hobbyist Programmer
 
bivhitscar's Avatar
 
Join Date: Oct 2005
Location: Melbourne, Australia
Posts: 126
Rep Power: 3 bivhitscar is on a distinguished road
I know what it does, but only because I compiled it. I'd be interested to see if anyone can figure it out without doing that.
__________________
it's ironic considerate rarity patron of love higher knowledge engulfs me...
bivhitscar is offline   Reply With Quote
Old Nov 8th, 2005, 7:17 AM   #3
sinix
Programmer
 
sinix's Avatar
 
Join Date: Nov 2005
Location: China
Posts: 47
Rep Power: 0 sinix is on a distinguished road
Send a message via MSN to sinix
the man wrote this program is a super maaaan,I think: ( hohoo
sinix is offline   Reply With Quote
Old Nov 8th, 2005, 7:18 AM   #4
zorin
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 218
Rep Power: 4 zorin is on a distinguished road
Do you know what this is doing or are you disguising it as a homework question you have been given?
zorin is offline   Reply With Quote
Old Nov 8th, 2005, 7:20 AM   #5
bivhitscar
Hobbyist Programmer
 
bivhitscar's Avatar
 
Join Date: Oct 2005
Location: Melbourne, Australia
Posts: 126
Rep Power: 3 bivhitscar is on a distinguished road
Quote:
Originally Posted by zorin
Do you know what this is doing or are you disguising it as a homework question you have been given?

It's not hard to figure out if you compile it. *shrug*

Although, don't expect an explanation of how it works. :p
__________________
it's ironic considerate rarity patron of love higher knowledge engulfs me...
bivhitscar is offline   Reply With Quote
Old Nov 8th, 2005, 7:25 AM   #6
Polyphemus_
Expert Programmer
 
Polyphemus_'s Avatar
 
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4 Polyphemus_ is on a distinguished road
i'm wondering how it works as well
Polyphemus_ is offline   Reply With Quote
Old Nov 8th, 2005, 7:29 AM   #7
sinix
Programmer
 
sinix's Avatar
 
Join Date: Nov 2005
Location: China
Posts: 47
Rep Power: 0 sinix is on a distinguished road
Send a message via MSN to sinix
It's not my homework.I heard that this is a best program in a programming competition,so i post it here.
sinix is offline   Reply With Quote
Old Nov 8th, 2005, 7:31 AM   #8
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
www.ioccc.org for more obfuscated C code.
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Old Nov 8th, 2005, 7:46 AM   #9
zorin
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 218
Rep Power: 4 zorin is on a distinguished road
I was going to comple it but im at college and we dont have any good software. Ill check it out when im home and post back
zorin is offline   Reply With Quote
Old Nov 8th, 2005, 7:58 AM   #10
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
the program output is:

31415926535897932384626433832795028841971693993751058209749445923078164062862089
98628034825342117067982148086513282306647093844609550582231725359408128481117450
28410270193852110555964462294895493038196442881097566593344612847564823378678316
52712019091456485669234603486104543266482133936072602491412737245870066063155881
74881520920962829254091715364367892590360011330530548820466521384146951941511609
43305727036575959195309218611738193261179310511854807446237996274956735188575272
48912279381830119491298336733624406566430860213949463952247371907021798609437027
70539217176293176752384674818467669405132000568127145263560827785771342757789609
17363717872146844090122495343014654958537105079227968925892354201995611212902196
08640344181598136297747713099605187072113499999983729780499510597317328160963185

what is so good there???
ivan 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 9:31 AM.

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