fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. for (int i=0; ; i++){
  5. double x, y, v;
  6. int res = fscanf(stdin, "%lf %lf %*f %lf", &x, &y, &v);
  7. if (res == EOF) break;
  8. if (res != 3) {
  9. fscanf(stdin, "%*[^\n]");
  10. } else {
  11. printf("%f %f %f\n", x, y, v);
  12. }
  13. }
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 10320KB
stdin
quick brown
fox jumps
over the lazy
dog
1     1     1            0.042580
 1     1     2            0.049331
 1     1     3            0.038605
 1     1     4            0.049181
stdout
1.000000 1.000000 0.042580
1.000000 1.000000 0.049331
1.000000 1.000000 0.038605
1.000000 1.000000 0.049181