You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
554 B
61 lines
554 B
#! /usr/bin/bc -q
|
|
|
|
define z(a[]) {
|
|
for (i = 0; i < l; ++i) {
|
|
a[i]
|
|
}
|
|
}
|
|
|
|
define x(a[]) {
|
|
|
|
# Test for separate vars and arrays.
|
|
auto a
|
|
|
|
for (a = 0; a < l; ++a) {
|
|
a[a] = -a
|
|
}
|
|
|
|
z(a[])
|
|
}
|
|
|
|
define g(x[], y[]) {
|
|
return x[0] - y[0]
|
|
}
|
|
|
|
define h(y[], x[]) {
|
|
return g(x[], y[])
|
|
}
|
|
|
|
define m(*x[], *y[]) {
|
|
return x[0] / y[0]
|
|
}
|
|
|
|
define n(*y[], *x[]) {
|
|
return m(x[], y[])
|
|
}
|
|
|
|
for (i = 0; i < 101; ++i) {
|
|
a[i] = i
|
|
}
|
|
|
|
a[104] = 204
|
|
|
|
l = length(a[])
|
|
|
|
for (i = 0; i <= l; ++i) {
|
|
a[i]
|
|
}
|
|
|
|
z(a[])
|
|
x(a[])
|
|
z(a[])
|
|
l
|
|
|
|
x[0] = 5
|
|
y[0] = 4
|
|
|
|
h(x[], y[])
|
|
n(x[], y[])
|
|
|
|
halt
|