Content deleted Content added
→C implementation: format code |
No edit summary |
||
Line 19:
==[[ALGOL 60]] implementation==
<syntaxhighlight lang="Pascal" line>
begin integer i; real y; real array a[0:10];
real procedure f(t); real t; value t;
Line 37:
This shows a C implementation equivalent to the above ALGOL 60.
<syntaxhighlight lang="C" line>
#include <math.h>
#include <stdio.h>
double f
{
return sqrt(fabs
}
int main
{
double a[11], y;
Line 53:
for (int i = 10; i >= 0; i--) {
y = f
if (y > 400)
printf("%d TOO LARGE\n", i);
else
printf("%d %
}
}
Line 65:
This shows a Python implementation.
<syntaxhighlight lang="
def f(t)
return
a = [float(input()) for _ in range(11)]
|