输入的整数之间和前后只会出现空格或者回车。输入数据保证合法。
例如: 输入:
123 -789
输出:
123
-789
var a, b : longint; function readint : longint; var num : longint; // 存储读取到的整数 negative : longint; // 负数标识 c : char; // 存储当前读取到的字符 begin num := 0; negative := 0; read(c); while ((c < '0') or (c > '9')) and (c <> '-') do 1; if (c = '-') then negative := 1 else 2; read(c); while 3 do begin 4; read(c); end; if negative = 1 then 5; exit(num); end; begin a := readint( ); b := readint( ); writeln(a); writeln(b); end.
