Re: A puzzle
Re: A puzzle
- Subject: Re: A puzzle
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 21 Nov 2008 21:46:25 -0500
On Fri, Nov 21, 2008 at 9:31 PM, Philip Aker
<email@hidden> wrote:
Also, is the C code dynamically allocating storage for the result or is it using a pre-defined size?
Allocating storage? The C code is using nothing but integers.
#include <stdio.h>
int main(int argc, char *argv[])
{
int total=0;
int i;
for (i=0; i<1000000; ++i)
{
int j;
for (j=i; j; j/=10)
if (1 == j) total++;
}
printf("%d\n", total);
return 0;
}
--
Mark J. Reed <
email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden