TPK algorithm: Difference between revisions

Content deleted Content added
C implementation: format code
Line 43:
double f (double t)
{
return sqrt (fabs (t)) + 5 * pow (t, 3);
}
 
Line 50:
double a[11], y;
for (int i = 0; i < 11; i++)
scanf ("%lf", &a[i]);
 
for (int i = 10; i >= 0; i--) {
y = f (a[i]);
if (y > 400)
printf ("%d TOO LARGE\n", i);
else
printf ("%d %f\n", i, y);
}
}