Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 deletions
20
Task/Variadic-function/Aime/variadic-function-1.aime
Normal file
20
Task/Variadic-function/Aime/variadic-function-1.aime
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
void
|
||||
f(...)
|
||||
{
|
||||
integer i;
|
||||
|
||||
i = 0;
|
||||
while (i < count()) {
|
||||
o_text($i);
|
||||
o_byte('\n');
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
integer
|
||||
main(void)
|
||||
{
|
||||
f("Mary", "had", "a", "little", "lamb");
|
||||
|
||||
return 0;
|
||||
}
|
||||
52
Task/Variadic-function/Aime/variadic-function-2.aime
Normal file
52
Task/Variadic-function/Aime/variadic-function-2.aime
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
void
|
||||
output_date(date d)
|
||||
{
|
||||
o_integer(d_year(d));
|
||||
o_byte('/');
|
||||
o_finteger(2, d_y_month(d));
|
||||
o_byte('/');
|
||||
o_finteger(2, d_m_day(d));
|
||||
}
|
||||
|
||||
void
|
||||
output_real(real x)
|
||||
{
|
||||
o_real(8, x);
|
||||
}
|
||||
|
||||
void
|
||||
g(...)
|
||||
{
|
||||
integer i;
|
||||
record r;
|
||||
|
||||
r_put(r, "integer", o_integer);
|
||||
r_put(r, "real", output_real);
|
||||
r_put(r, "text", o_text);
|
||||
r_put(r, "date", output_date);
|
||||
|
||||
i = 0;
|
||||
while (i < count()) {
|
||||
call(r_query(r, __type($i)), $i);
|
||||
o_byte('\n');
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
date
|
||||
now(void)
|
||||
{
|
||||
date d;
|
||||
|
||||
d_now(d);
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
integer
|
||||
main(void)
|
||||
{
|
||||
g("X.1", 707, .5, now());
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue