Hi All,
I started programming today and I’ve been trying to google my way through this first easy question, but I can’t seem to get it, any help in the right direction would be great. I seem to get time exceeded, but I’ve tried a few different ways of doing it and seem to be getting wrong answer now.
many thanks,
<?php $line = trim(fgets(STDIN)); while ($line != '42') { fwrite(STDOUT, $line."n"); } ?>And this one as well
<?php for(; ;) { $line = fgets(STDIN); if ($line='42') { break; } fwrite(STDOUT, $line."n"); } ?>