fork(1) download
  1. #include <stdio.h>
  2.  
  3. double ReadNext(FILE *file, double def)
  4. {
  5. double x = def;
  6. fscanf(file, "%lf%*[^\n] ", &x);
  7. return x;
  8. }
  9.  
  10. int main(void)
  11. {
  12. int i;
  13. for(i=0;i<7;++i)
  14. {
  15. printf("%lf\n",ReadNext(stdin,0));
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 2164KB
stdin
3

5
6

7
stdout
3.000000
5.000000
6.000000
7.000000
0.000000
0.000000
0.000000