14
\$\begingroup\$

When reading several pieces of input as command-line arguments, it is common practice to read each piece as a different argument. The command-line arguments now provide an array of the input pieces.

Should submissions that use different input formats also be allowed to read an array of input pieces by default?

Please vote the answers below up or down. Feel free to add answers of your own.

\$\endgroup\$
21
\$\begingroup\$

It is allowed to read input as a single function argument.

If the question requires to accept, e.g., two integers as input, it is allowed to read them as the single function argument [4,2] (array).

\$\endgroup\$
  • \$\begingroup\$ This has my upvote. \$\endgroup\$ – Dennis Jun 16 '15 at 16:13
19
\$\begingroup\$

It is allowed to read an array of input pieces from STDIN.

If the question requires to accept, e.g., two integers as input, it is allowed to read them as the string [4,2] from STDIN (or whatever your language of choice uses as array syntax).

\$\endgroup\$
  • \$\begingroup\$ This has my upvote. \$\endgroup\$ – Dennis Jun 16 '15 at 16:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .