Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,29 @@
|
|||
import extensions;
|
||||
import extensions'math;
|
||||
|
||||
public program()
|
||||
{
|
||||
real[] inputs := new real[](11);
|
||||
console.printLine("Please enter 11 numbers :");
|
||||
for(int i := 0, i < 11, i += 1)
|
||||
{
|
||||
inputs[i] := console.readLine().toReal()
|
||||
};
|
||||
|
||||
console.printLine("Evaluating f(x) = |x|^0.5 + 5x^3 for the given inputs :");
|
||||
for(int i := 10, i >= 0, i -= 1)
|
||||
{
|
||||
real result := sqrt(abs(inputs[i])) + 5 * power(inputs[i], 3);
|
||||
|
||||
console.print("f(", inputs[i], ")=");
|
||||
|
||||
if (result > 400)
|
||||
{
|
||||
console.printLine("Overflow!")
|
||||
}
|
||||
else
|
||||
{
|
||||
console.printLine(result)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue