Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Arithmetic-Integer/D/arithmetic-integer-1.d
Normal file
17
Task/Arithmetic-Integer/D/arithmetic-integer-1.d
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import std.stdio, std.string, std.conv;
|
||||
|
||||
void main() {
|
||||
int a = 10, b = 20;
|
||||
try {
|
||||
a = readln().strip().to!int();
|
||||
b = readln().strip().to!int();
|
||||
} catch (StdioException e) {}
|
||||
writeln("a = ", a, ", b = ", b);
|
||||
|
||||
writeln("a + b = ", a + b);
|
||||
writeln("a - b = ", a - b);
|
||||
writeln("a * b = ", a * b);
|
||||
writeln("a / b = ", a / b);
|
||||
writeln("a % b = ", a % b);
|
||||
writeln("a ^^ b = ", a ^^ b);
|
||||
}
|
||||
13
Task/Arithmetic-Integer/D/arithmetic-integer-2.d
Normal file
13
Task/Arithmetic-Integer/D/arithmetic-integer-2.d
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import std.stdio, std.string, std.conv, std.meta;
|
||||
|
||||
void main() {
|
||||
int a = -16, b = 5;
|
||||
try {
|
||||
a = readln().strip().to!int();
|
||||
b = readln().strip().to!int();
|
||||
} catch (StdioException e) {}
|
||||
writeln("a = ", a, ", b = ", b);
|
||||
|
||||
foreach (op; AliasSeq!("+", "-", "*", "/", "%", "^^"))
|
||||
mixin(`writeln("a ` ~ op ~ ` b = ", a` ~ op ~ `b);`);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue