fork(1) download
  1. <?php
  2.  
  3. fscanf(STDIN, "%d\n", $tc);
  4.  
  5. for($t=0; $t<$tc; $t++)
  6. {
  7. fscanf(STDIN, "%d %d", $x, $y);
  8. // $y = trim(fgets(STDIN));
  9. // $z = trim(fgets(STDIN));
  10.  
  11. for($i=0; $i<$x; $i++)
  12. {
  13. // $ax[] = trim(fgets(STDIN));
  14. fscanf(STDIN,"%d", $ax[]);
  15. }
  16.  
  17. for($j=0; $j<$y; $j++)
  18. {
  19. //$ay[] = trim(fgets(STDIN));
  20. fscanf(STDIN,"%d", $by[]);
  21. }
  22.  
  23. for($i=0; $i<$x; $i++)
  24. {
  25. printf("%d ", $ax[$i]);
  26. }
  27. echo "\n";
  28. for($k=0; $k<$y; $k++)
  29. {
  30. printf("%d ", $ay[$k]);
  31. }
  32.  
  33. }
  34. ?>
Success #stdin #stdout #stderr 0.01s 82880KB
stdin
1
3 3
1 2 3
4 5 6
stdout
1 4 0 
0 0 0 
stderr
PHP Notice:  Undefined variable: ay in /home/JostDh/prog.php on line 30
PHP Notice:  Undefined variable: ay in /home/JostDh/prog.php on line 30
PHP Notice:  Undefined variable: ay in /home/JostDh/prog.php on line 30