Sha256: 198255cb3474d6141dd00bb58b572425bfe300b07b2be70bca69c8c1e8d8a791
Contents?: true
Size: 1.03 KB
Versions: 10
Compression:
Stored size: 1.03 KB
Contents
Works with Gardens Point Component Pascal MODULE Arithmetic; IMPORT CPmain,Console,RTS; VAR x,y : INTEGER; arg : ARRAY 128 OF CHAR; status : BOOLEAN; PROCEDURE Error(IN str : ARRAY OF CHAR); BEGIN Console.WriteString(str);Console.WriteLn; HALT(1) END Error; BEGIN IF CPmain.ArgNumber() < 2 THEN Error("Give me two integers!") END; CPmain.GetArg(0,arg); RTS.StrToInt(arg,x,status); IF ~status THEN Error("Can't convert '"+arg+"' to Integer") END; CPmain.GetArg(1,arg); RTS.StrToInt(arg,y,status); IF ~status THEN Error("Can't convert '"+arg+"' to Integer") END; Console.WriteString("x + y >");Console.WriteInt(x + y,6);Console.WriteLn; Console.WriteString("x - y >");Console.WriteInt(x - y,6);Console.WriteLn; Console.WriteString("x * y >");Console.WriteInt(x * y,6);Console.WriteLn; Console.WriteString("x / y >");Console.WriteInt(x DIV y,6);Console.WriteLn; Console.WriteString("x MOD y >");Console.WriteInt(x MOD y,6);Console.WriteLn; END Arithmetic. command: <i>cprun Arithmetic 12 23</i><br/>
Version data entries
10 entries across 7 versions & 1 rubygems