Name: Anonymous 2009-04-01 16:01
Take a number from the standard input and output "Sussman" this many times, using Python.
print "Sussman\n" * int(raw_input())
import java.util.*;
public class A{
public static void main(String[] b){
int n=new Scanner(System.in).nextInt();
for(int i=0;i<n;i++)System.out.print("Sussman");
}
}
main = getLine >>= \l -> putStrLn $ concat $ replicate (read l) "Sussman\n"
getLine >>= (\n -> mapM_ putStrLn $ flip replicate "Sussman" (read n))
main flip = replicateM_ (putStrLn "Sussman") . read =<< getLine
main = flip replicateM_ (putStrLn "Sussman") . read =<< getLine
n = read
if n = 1 then
print sussman
else if n = 2 then
print sussman sussman
else if n = 3 then
print sussman sussman
else if n = 4 then
print sussman sussman
else if n = 5 then
print sussman sussman
else if n = 6 then
print sussman sussman
import java.io.*;
import java.util.*;
import java.lang.reflect.*;
public class Sussmans {
private static final String FILENAME = "SussmansPrint.java";
public static void main(String[] args) throws Exception {
String base = FILENAME.substring(0,FILENAME.lastIndexOf("."));
System.out.print("Please enter the number of Sussmans you wish to print: ");
int i = (new Scanner(System.in)).nextInt();
PrintWriter pw = new PrintWriter(new FileOutputStream(FILENAME));
pw.write("public class "+base+" {\n"+
"\tpublic static void main(String[] args) {\n");
for(int k=0; k<i; k++) {
pw.write("\t\tSystem.out.print(\"Sussman\");\n");
}
pw.write("\t}\n"+
"}");
pw.close();
Process compiler = Runtime.getRuntime().exec("javac "+FILENAME);
compiler.waitFor();
SussClassLoader CLoad = new SussClassLoader();
Class bytecode = CLoad.findClass(base);
Class[] argz = { (new String[0]).getClass() };
Method main = bytecode.getMethod("main", argz);
String[] arguments = new String[args.length];
System.arraycopy(args, 0, arguments, 0, arguments.length);
Object[] arges = {arguments};
main.invoke(null, arges);
System.exit(0);
}
}
class SussClassLoader extends ClassLoader {
public Class findClass(String fname) {
File file = new File(fname+".class");
try {
byte[] bytes = new byte[(int)(file.length())];
FileInputStream fis = new FileInputStream(file);
fis.read(bytes);
fis.close();
return defineClass(fname, bytes, 0, bytes.length);
}
catch(Exception e) {
System.out.println(e.getMessage());
return null;
}
}
}
10 INPUT A
20 FOR X = 1 TO A
30 PRINT "SUSSMAN"
40 NEXT A
print "Sussman\n"x<>
test code input z{ok, [N]} = io:fread("","~d"),
io:put_chars(lists:duplicate(N,"Sussman\n")).
puts "you're answer is among these:"; 65534.times {|s| puts "#{s+2} Sussmen"}
LET A @LEGS \EING
10 IF A < 1
END
END IF
WUNT \AUSG "SUSSMAN\n"
LET A A-1
GOTO 10
bits 32
cpu 586
global _main
extern _scanf
extern _puts
section .rodata
format: db "%d",0
string: db "Sussman",0
section .text
_main:
enter 8,0
mov dword [esp],format
lea eax,[esp+4]
mov [eax],eax
call _scanf
cmp eax,1
jnz .end
mov esi,[esp+4]
cmp esi,1
jl .end
mov dword [esp],string
.loop:
call _puts
dec esi
jnz .loop
.end:
xor eax,eax
leave
ret
(define (print-suss n)
(if (< n 1)
#t
(and (display "sussman\n")
(print-suss (- n 1)))))
(display "Sussman") and (newline), and called the procedure print-sussman.
Sussman.bf. If you want a number larger than 9 you will need to use the correct ASCII character.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
++++++++++>
,------------------------------------------------
[<<<<<<<<.>.>.>.>.>.>.>.>-]
yes "Sussman" | head -n 666chris@chrislaptop ~> n=`cat`; yes "Sussman" | head -n $n | tr -d '\n'
fish: Unknown command “n=`cat`”. Did you mean “set n `cat`”? For information on
assigning values to variables, see the help section on the set command by typing
“help set”.
head: option requires an argument -- n
usage: head [-n lines | -c bytes] [file ...]
read n;yes "Sussman"|head -n$n
C:\> read n;yes "Sussman"|head -n$n
Bad command or filename - "read".
Bad command or filename - "head".
C:\>
(defun sussman (n)
(if (> n 0)
(progn
(format t "Sussman~%")
(sussman (1- n)))))
(sussman (coerce (read) 'number))