- initial import
git-svn-id: http://moon:8086/svn/mips@1 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/* -*- mode: c -*-
|
||||
* $Id: nestedloop.c,v 1.3 2007/05/03 16:55:46 laurov Exp $
|
||||
* http://www.bagley.org/~doug/shootout/
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
#ifdef SMALL_PROBLEM_SIZE
|
||||
#define LENGTH 30
|
||||
#else
|
||||
#define LENGTH 46
|
||||
#endif
|
||||
int n = ((argc == 2) ? atoi(argv[1]) : LENGTH);
|
||||
int a, b, c, d, e, f, x=0;
|
||||
|
||||
for (a=0; a<n; a++)
|
||||
for (b=0; b<n; b++)
|
||||
for (c=0; c<n; c++)
|
||||
for (d=0; d<n; d++)
|
||||
for (e=0; e<n; e++)
|
||||
for (f=0; f<n; f++)
|
||||
x++;
|
||||
|
||||
printf("%d\n", x);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user