Posted By

mustam on 08/19/09


Tagged

io


Versions (?)

Set double-list from starndard input numbers


 / Published in: C
 

e.g.


seq 10 | ./a.out

  1. #include <stdio.h>
  2.  
  3. #define MAX (512*512)
  4.  
  5. int main(int argc, char **argv)
  6. {
  7. int i, n=0;
  8. double v[MAX];
  9.  
  10. do i=scanf("%lf", v+n);
  11. while(i==1 && n++<MAX);
  12.  
  13. /* as you please */
  14.  
  15. return 0;
  16. }

Report this snippet  

You need to login to post a comment.