How stdin.readf ignore space char?

lili akozhao at tencent.com
Tue Sep 3 12:55:29 UTC 2019


Hi guys:

    input is two line, first line is a number n and second line is 
n float point number,
     e.g. 3
          1.1 2.2 3.3
     how use stdin.readf get all number. i code below but not work 
well.

         int n;
         stdin.readf!"%d\n"(n);
         writeln("read n:",n);

         foreach (i; 0..n)
         {
                 double x;
                 stdin.readf!"%f"(x); //only return first number, 
why?
                 writeln(x);
         }



More information about the Digitalmars-d-learn mailing list