URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
#include <stdio.h>
|
#include <stdio.h>
|
|
|
int acker(int, int);
|
int acker(int, int);
|
|
|
int
|
int
|
main(void)
|
main(void)
|
{
|
{
|
int n = acker(3,6);
|
int n = acker(3,6);
|
if (n != 509)
|
if (n != 509)
|
printf("acker(3,6) = %d != 509\n", n);
|
printf("acker(3,6) = %d != 509\n", n);
|
return(0);
|
return(0);
|
}
|
}
|
|
|
int
|
int
|
acker(int x,int y)
|
acker(int x,int y)
|
{
|
{
|
if (x==0)
|
if (x==0)
|
return(y+1);
|
return(y+1);
|
else if (y==0)
|
else if (y==0)
|
return(acker(x-1,1));
|
return(acker(x-1,1));
|
else
|
else
|
return(acker(x-1, acker(x, y-1)));
|
return(acker(x-1, acker(x, y-1)));
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.