RosettaCodeData/Task/Integer-comparison/D/integer-comparison.d

19 lines
367 B
D
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
void main() {
2014-01-17 05:32:22 +00:00
import std.stdio, std.conv, std.string;
2013-04-10 21:29:02 -07:00
int a = 10, b = 20;
try {
2014-01-17 05:32:22 +00:00
a = readln.strip.to!int;
b = readln.strip.to!int;
2013-04-10 21:29:02 -07:00
} catch (StdioException) {}
if (a < b)
writeln(a, " is less than ", b);
if (a == b)
writeln(a, " is equal to ", b);
if (a > b)
writeln(a, " is greater than ", b);
}