Created
April 10, 2015 02:18
-
-
Save mos3abof/11c41a1380a08f263031 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A quick solution for the question in this blog post: | |
* http://www.thousandtyone.com/blog/EasierThanFizzBuzzWhyCantProgrammersPrint100To1.aspx | |
* | |
* Took me 30 seconds, without the comments. | |
* | |
* The problem: | |
* Print 100 to 1. | |
* You need to start with "for(int i=0;" and continue from there. | |
* You cannot write anything before "for(int i=0;". | |
* You can't use two loops. | |
* | |
* To run it use this command: | |
* php 100_countdown.php | |
*/ | |
for($i = 0; $i < 100; $i++) | |
{ | |
print (100 - $i) . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you are wrong. its
😆