Possible difference in compilers?

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 1 00:49:57 PDT 2014


Charles:

> My solution I came up with (and works locally) is:
>
> import std.stdio;
> void main() {
>      int height=1,t=1,oldN=0,n;
>      readf(" %d\n", &t);
>      foreach (i;0 .. t) {
>          readf(" %d\n", &n);
>          foreach (j; oldN .. n)

I suggest to add a blank line after the import, to move the 
import inside the main, to add a space after the commas, and to 
add an immutable to foreach variable.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list