Example: Reads stdin and writes it to stdout with an argument counter.
import std.stdio;
void main()
{
string line;
for (size_t count = 0; (line = readln) !is null; count++)
{
writeln("Input ", count, ": ", line);
}
}void writeln(T...)(T args)Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.
args | the items to write to stdout |
Example: Reads stdin and writes it to stdout with an argument counter.
import std.stdio;
void main()
{
string line;
for (size_t count = 0; (line = readln) !is null; count++)
{
writeln("Input ", count, ": ", line);
}
}