Name:
Anonymous
2010-01-01 23:19
Let X be an integer.
1) Read in integer X from standard input
3) Let Y be X multiplied by 2
4) output "SUSSMAN!!!!!!" Y times
Name:
Anonymous
2010-01-02 15:27
Hello /prog/ I'm a first year computer science student how do you like my code?
I hope this helps with your homework!
<?php
/////////////////////////////////////////////////////
// Prints exactly as many Sußmen as the user wants
// Copyright © 2010 me
//////////////////////////////////
// ALL RIGHTS RESERVERD
//////////////////////////////////////////////////
echo "How many Sußmen do you want? "
;$amount = ''; # for some reason I need the ; at the beginning here. PHP is buggy lol
$myStandardInFileHandle = fopen('php://stdin', 'r'); # Thanks Joe!
#$amount = fread($myStandardInFileHandel, 999999))
# $amount = fread($myStandardInFileHandle = fopen('php://stdin', 'r');
$amount = fgets($myStandardInFileHandle, 999999); # Thanks #php!
##for($amount = 0; $amount < $amount; $amount + 1) { # why isn' this working?
#while($i > $amount) {
$myLoopCounterVariable = 1;
while($i < $amount) {$myLoopCounterVariable=$myLoopCounterVariable+1;
if($myLoopCounterVariable % 2 == 0){$i=$i+1;} # WOW PHP is cool!
echo "SUßMAN!!!!!!\n";}
echo "SUßMAN!!!!!!\n"; # for some reason the loop dies too early :(
?>